Moving image encoding device and moving image decoding device based on adaptive switching among transformation block sizes

ABSTRACT

An encoding controlling unit 3 selects one transformation block size which provides an optimal degree of encoding efficiency from a set of transformation block sizes which are determined in accordance with an encoding mode 7, and includes the transformation block size selected thereby in optimal compression parameters 20a to notify the transformation block size to a transformation/quantization unit 19, and the transformation/quantization unit 19 divides an optimal prediction differential signal 13a into blocks having the transformation block size included in the optimal compression parameters 20a, and carries out a transformation and quantization process on each of the blocks to generate compressed data 21.

This application is a Continuation of copending U.S. application Ser.No. 15/920,105 filed on Mar. 13, 2018, which is a Divisional of U.S.application Ser. No. 15/443,431 filed on Feb. 27, 2017 (now U.S. Pat.No. 9,973,753 issued on May 15, 2018), which is a Continuation ofapplication Ser. No. 13/639,134 filed on Oct. 18, 2012, which was filedas PCT International Application No. PCT/JP2011/001953 on Mar. 31, 2011,which claims the benefit under 35 U.S.C. § 119(a) to Patent ApplicationNo. 2010-090534, filed in Japan on Apr. 9, 2010, all of which are herebyexpressly incorporated by reference into the present application.

FIELD OF THE INVENTION

The present invention relates to a moving image encoding device whichdivides a moving image into predetermined areas and encodes the movingimage in units of one area, and a moving image decoding device whichdecodes an encoded moving image in units of one predetermined area.

BACKGROUND OF THE INVENTION

Conventionally, in an international standard video encoding system, suchas MPEG or ITU-T H.26x, a method of defining block data (referred to as“macroblock” from here on) as a unit, the block data being a combinationof 16×16 pixels of brightness signal and 8×8 pixels of color differencesignal corresponding to the 16×16 pixels of brightness signal, andcompressing each frame of a video signal in units of block data inaccordance with a motion compensation technique, and an orthogonaltransformation/transform coefficient quantization technique is used.

The motion compensation technique is used to reduce the redundancy of asignal in a time direction for each macroblock by using a highcorrelation existing between video frames. In accordance with thismotion compensation technique, an already-encoded frame which has beenpreviously encoded is stored in a memory as a reference image, and ablock area which provides the smallest difference in electric powerbetween the block area itself and the current macroblock which is atarget block for the motion-compensated prediction is searched forthrough a search range predetermined in the reference image, and aspatial displacement between the spatial position of the currentmacroblock and the spatial position of the block area in the referenceimage which is determined as the result of the search is then encoded asa motion vector.

Further, in accordance with the orthogonal transformation/transformcoefficient quantization technique, a differential signal which isacquired by subtracting a prediction signal acquired as the result ofthe above-mentioned motion-compensated prediction from the currentmacroblock is orthogonal transformed and quantized so that the amount ofinformation is compressed.

In the case of MPEG-4 Visual, each block which is used as a unit formotion-compensated prediction has a minimum size of 8×8 pixels, and DCT(discrete cosine transform) having a 8×8 pixel size is used also fororthogonal transformation. In contrast with this, in the case of (ITU-TH.264) MPEG-4 AVC (Moving Picture Experts Group-4 Advanced VideoCoding), a motion-compensated prediction with a block size smaller than8×8 pixels is prepared in order to efficiently carry out encoding oneven an area, such as a boundary between objects, having a smallcorrelation between pixels in a spacial direction. Further, in theorthogonal transformation, the compression and encoding can be carriedout by adaptively switching between 8×8-pixel DCT having integer pixelaccuracy and 4×4-pixel DCT having integer pixel accuracy on aper-macroblock basis.

In accordance with such a conventional international standard videoimage encoding method, particularly when the resolution of the imagebecomes higher resulting from the macroblock size being fixed, an areawhich is covered by each macroblock is easily localized because themacroblock size is fixed. As a result, there occurs a case in which aperipheral macroblock is placed in the same encoding mode or the samemotion vector is allocated to a peripheral macroblock. In such a case,because the overhead of encoding mode information, motion vectorinformation and so on which are encoded even though the predictionefficiency is not improved increases, the encoding efficiency of theentire encoder is reduced.

To solve such a problem, a device which switches between macroblocksizes in accordance with the resolution or the contents of an image isdisclosed (for example, refer to patent reference 1). The moving imageencoding device disclosed by patent reference 1 can carry outcompression and encoding by switching between selectable orthogonaltransformation block sizes or between selectable sets of orthogonaltransformation block sizes in accordance with the macroblock size.

RELATED ART DOCUMENT Patent Reference

Patent reference 1: WO 2007/034918

SUMMARY OF THE INVENTION Problems to be Solved by the Invention

A problem with the conventional international standard video imageencoding methods and the invention disclosed by patent reference 1 is,however, that because transformation cannot be carried out by switchingamong a plurality of orthogonal transformation block sizes within eachmacroblock, the encoding efficiency is reduced particularly when anobject having a different movement or a different pattern exists in amacroblock.

The present invention is made in order to solve the above-mentionedproblem, and it is therefore an object of the present invention toprovide a moving image encoding device which can carry out compressionand encoding by adaptively switching among orthogonal transformationblock sizes for each area which is a unit for motion-compensatedprediction in each macroblock, and a moving image decoding device.

Means for Solving the Problem

In accordance with the present invention, there is provided a movingimage encoding device including: a block dividing unit for dividing aninputted image into macroblock images of two or more blocks each havinga predetermined size and dividing each of the macroblock images into ablock image of one or more blocks according to an encoding mode tooutput the block image; an intra-prediction unit for, when the blockimage is inputted thereto, carrying out an intra-frame prediction on theblock image by using an image signal in a frame to generate a predictionimage; a motion-compensated prediction unit for, when the block image isinputted thereto, carrying out an image motion-compensated prediction onthe block by using one or more frames of reference images to generate aprediction image; a transformation/quantization unit for carrying out atransformation and quantization process on a prediction differencesignal which is generated by subtracting the prediction image outputtedfrom either one of the intra-prediction unit and the motion-compensatedprediction unit from the block image outputted from the block dividingunit to generate compressed data; a variable length encoding unit forentropy-encoding the compressed data to multiplex the compressed dataentropy-encoded thereby into a bitstream; and an encoding controllingunit for selecting a certain transformation block size from a set oftransformation block sizes predetermined for a block image to notify thetransformation block size selected thereby to atransformation/quantization unit, in which thetransformation/quantization unit divides a prediction difference signalinto blocks having the transformation block size notified thereto fromthe encoding controlling unit, and carries out a transformation andquantization process on each of the blocks to generate compressed data.

In accordance with the present invention, there is provided a movingimage decoding device including: a variable length decoding unit forreceiving a bitstream inputted thereto and compression-encoded in unitsof each of macroblocks having a predetermined size into which an imageis divided and then entropy-decoding an encoding mode in units of one ofsaid macroblocks from said bitstream, and for entropy-decodingprediction parameters, information indicating a transformation blocksize, and compressed data in units of one of the macroblocks into whichthe image is divided according to said decoded encoding mode; anintra-prediction unit for, when said prediction parameters are inputtedthereto, generating a prediction image by using an intra prediction modeand a decoded image signal in a frame which are included in theprediction parameters; a motion-compensated prediction unit for, whensaid prediction parameters are inputted thereto, carrying out amotion-compensated prediction by using a motion vector included in theprediction parameters and a reference image specified by a referenceimage index included in the prediction parameters to generate aprediction image; an inverse quantization/inverse transformation unitfor carrying out an inverse quantization and inverse transformationprocess on said compressed data by using said information indicating thetransformation block size to generate a decoded prediction differencesignal; and an adding unit for adding the prediction image outputtedfrom either one of the said intra-prediction unit and saidmotion-compensated prediction unit to said decoded prediction differencesignal to output a decoded image signal, in which the inversequantization/inverse transformation unit determines a transformationblock size on the basis of the decoded information indicating thetransformation block size and carries out an inverse transformation andinverse quantization process on the compressed data in units of oneblock having the transformation block size.

Advantages of the Invention

Because the moving image encoding device in accordance with the presentinvention includes: the block dividing unit for dividing an inputtedimage into macroblock images of two or more blocks each having thepredetermined size and dividing each of the macroblock images into ablock image of one or more blocks according to an encoding mode tooutput the block image; the intra-prediction unit for, when the blockimage is inputted thereto, carrying out an intra-frame prediction on theblock image by using an image signal in a frame to generate a predictionimage; the motion-compensated prediction unit for, when the block imageis inputted thereto, carrying out an image motion-compensated predictionon the block by using one or more frames of reference images to generatea prediction image; the transformation/quantization unit for carryingout a transformation and quantization process on a prediction differencesignal which is generated by subtracting the prediction image outputtedfrom either one of the intra-prediction unit and the motion-compensatedprediction unit from the block image outputted from the block dividingunit to generate compressed data; the variable length encoding unit forentropy-encoding the compressed data to multiplex the compressed dataentropy-encoded thereby into a bitstream; and the encoding controllingunit for notifying a certain transformation block size among a set oftransformation block sizes which are predetermined for a block image, inwhich the transformation/quantization unit divides the predictiondifference signal into blocks having the transformation block size andcarries out transformation and quantization process on each of theblocks to generate compressed data, a moving image encoding device and amoving image decoding device which can carry out compression andencoding by adaptively switching among the transformation block sizesfor each area which is a unit for motion-compensated prediction in eachmacroblock can be provided.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a block diagram showing the structure of a moving imageencoding device in accordance with Embodiment 1 of the presentinvention;

FIG. 2A is a view showing an example of encoding modes for pictures ineach of which predictive encoding in a time direction is carried out;

FIG. 2B is a view showing another example of the encoding modes forpictures in each of which predictive encoding in a time direction iscarried out;

FIG. 3 is a block diagram showing the internal structure of amotion-compensated prediction unit of the moving image encoding devicein accordance with Embodiment 1;

FIG. 4 is a view explaining a determining method of determining apredicted value of a motion vector in accordance with an encoding mode;

FIG. 5 is a view showing an example of adaptation of a transformationblock size in accordance with an encoding mode;

FIG. 6 is a view showing another example of the adaptation of atransformation block size in accordance with an encoding mode;

FIG. 7 is a block diagram showing the internal structure of atransformation/quantization unit of the moving image encoding device inaccordance with Embodiment 1;

FIG. 8 is a block diagram showing the structure of a moving imagedecoding device in accordance with Embodiment 1 of the presentinvention;

FIG. 9 is a block diagram showing the internal structure of a variablelength encoding unit of a moving image encoding device in accordancewith Embodiment 2 of the present invention;

FIG. 10 is a view showing an example of a binarization table in a statein which the binarization table is yet to be updated;

FIG. 11 is a view showing an example of a probability table;

FIG. 12 is a view showing an example of a state transition table;

FIG. 13A is a view showing the binarization table in binary treerepresentation, and FIG. 13B is a view showing a positional relationshipbetween a macroblock to be encoded and peripheral blocks;

FIG. 14 is a view showing an example of the binarization table in astate in which the binarization table has been updated;

FIG. 15 is a block diagram showing the internal structure of a variablelength decoding unit of a moving image decoding device in accordancewith Embodiment 2 of the present invention; and

FIG. 16 is a block diagram showing the internal structure of aninterpolated image generating unit with which a motion-compensatedprediction unit of a moving image encoding device in accordance withEmbodiment 3 of the present invention is provided.

EMBODIMENTS OF THE INVENTION

Hereafter, the preferred embodiments of the present invention will beexplained in detail with reference to the drawings.

Embodiment 1

In this Embodiment 1, a moving image encoding device which carries out amotion-compensated prediction between adjacent frames by using eachframe image of a video image as an input and carries out a compressionprocess using orthogonal transformation and quantization on an acquiredprediction difference signal, and, after that, carries out variablelength encoding to generate a bitstream, and an moving image decodingdevice which decodes the bitstream will be explained.

FIG. 1 is a block diagram showing the structure of a moving imageencoding device in accordance with Embodiment 1 of the presentinvention. The moving image encoding device shown in FIG. 1 includes ablock dividing unit 2 for dividing each frame image of an inputted videosignal 1 into macroblock images of a plurality of more blocks eachhaving a macroblock size 4 and further dividing each of the macroblockimages into a macro/subblock image 5 of one or more subblocks inaccordance with an encoding mode 7 to output this macro/subblock image5, an intra-prediction unit 8 for, when receiving a macro/subblock image5 inputted thereto, carrying out an intra-frame prediction on themacro/subblock image 5 by using an image signal stored in a memory 28for intra prediction to generate a prediction image 11, amotion-compensated prediction unit 9 for, when receiving amacro/subblock image 5 inputted thereto, carrying out amotion-compensated prediction on the macro/subblock image 5 by using areference image 15 stored in a motion-compensated prediction framememory 14 to generate a prediction image 17, a switching unit 6 forinputting a macro/subblock image 5 to either one of the intra-predictionunit 8 and the motion-compensated prediction unit 9 in accordance withthe encoding mode 7, a subtraction unit 12 for subtracting theprediction image 11 or 17 which is outputted from either one of theintra-prediction unit 8 and the motion-compensated prediction unit 9from the macro/subblock image 5 outputted from the block dividing unit 2to generate a prediction difference signal 13, atransformation/quantization unit 19 for carrying out a transformationand quantization process on the prediction difference signal 13 togenerate compressed data 21, a variable length encoding unit 23 forentropy-encoding the compressed data 21 to multiplex this compresseddata into the bitstream 30, an inverse quantization/inversetransformation unit 22 for carrying out an inverse transformation andinverse quantization process on the compressed data 21 to generate alocal decoded prediction difference signal 24, an adder unit 25 foradding the prediction image 11 or 17 outputted from either one of theintra-prediction unit 8 and the motion-compensated prediction unit 9 tothe output of the inverse quantization/inverse transformation unit 22 togenerate a local decoded image signal 26, the memory 28 for intraprediction for storing the local decoded image signal 26, a loop filterunit 27 for carrying out filtering on the local decoded image signal 26to generate a local decoded image 29, and the motion-compensatedprediction frame memory 14 for storing the local decoded image 29.

An encoding controlling unit 3 outputs pieces of information requiredfor the process carried out by each unit (the macroblock size 4,encoding modes 7, an optimum encoding mode 7 a, prediction parameters10, optimum prediction parameters 10 a or 18 a, compression parameters20, and optimum compression parameters 20 a). Hereafter, the details ofthe macroblock size 4 and the encoding mode 7 will be explained. Thedetails of the other pieces of information will be mentioned later.

The encoding controlling unit 3 notifies the block dividing unit 2 ofthe macroblock size 4 of each frame image of the inputted video signal1, and also notifies the block dividing unit 2 of all selectableencoding modes 7 in accordance with the picture type for each macroblock to be encoded. Although the encoding controlling unit 3 can selecta certain encoding mode from among a set of encoding modes, this set ofencoding modes is arbitrarily set up. For example, the encodingcontrolling unit can select a certain encoding mode from among a setshown in FIG. 2A or 2B which will be mentioned below.

FIG. 2A is a view showing an example of encoding modes for a P(Predictive) picture in each of which predictive encoding in a timedirection is carried out. In FIG. 2A, mb_mode0 to mb_mode2 show modes(inter) in each of which a macroblock (M×L pixel block) is encoded byusing an inter-frame prediction. mb_mode0 is the mode in which a motionvector is allocated to the whole of a macroblock, mc_mode1 and mc_mode2are the modes in each of which a macroblock is divided into equal partswhich are aligned horizontally or vertically, and different motionvectors are allocated to the subblocks into which the macroblock isdivided, respectively. mc_mode3 is the mode in which a macroblock isdivided into four parts, and different encoding modes (sub_mb_mode) areallocated to the four subblocks into which the macroblock is divided,respectively.

sub_mb_mode0 to sub_mb_mode4 are the modes each of which, when mb_mode3is selected as the encoding mode of a macroblock, can be allocated toeach of the four subblocks (m×1 pixel blocks) into which the macroblockis divided. sub_mb_mode0 is the mode (intra) in which a subblock isencoded by using an intra-frame prediction. The other modes are themodes (inter) which a subblock is encoded by using an inter-frameprediction. sub_mb_mode1 is the mode in which one motion vector isallocated to the whole of a subblock, sub_mc_mode2 and sub_mc_mode3 arethe modes in each of which a subblock is divided into equal parts whichare aligned horizontally or vertically, and different motion vectors areallocated to the subblocks into which the subblock is divided,respectively, and sub_mb_mode4 is the mode in which a subblock isdivided into four parts, and different motion vectors are allocated tothe four subblocks into which the subblock is divided, respectively.

Further, FIG. 2B is a view showing another example of encoding modes fora P picture in each of which predictive encoding in a time direction iscarried out. In FIG. 2B, mb_mode 0 to 6 are the modes (inter) in each ofwhich a macroblock (M×L pixel block) is encoded by using an inter frameprediction. mb_mode0 is the mode in which one motion vector is allocatedto the whole of a macroblock, and mb_mode1 to mb_mode6 are the modes ineach of which a macroblock is divided into two parts which are alignedhorizontally, vertically or diagonally, and different motion vectors areallocated to the two subblocks into which the macroblock is divided,respectively. mb_mode7 is the mode in which a macroblock is divided intofour parts, and different encoding modes (sub_mb_mode) are allocated tothe four subblocks into which the macroblock is divided, respectively.

sub_mb_mode0 to sub_mb_mode8 are the modes each of which, when mb_mode7is selected as the encoding mode of a macroblock, can be allocated toeach of the four subblocks (m×1 pixel blocks) into which the macroblockis divided. sub_mb_mode0 is the mode (intra) in which a subblock isencoded by using an intra-frame prediction. The other modes are themodes (inter) which a subblock is encoded by using an inter-frameprediction. sub_mb_mode1 is the mode in which one motion vector isallocated to the whole of a subblock, sub_mb_mode2 to sub_mb_mode7 arethe modes in each of which a subblock is divided into two parts whichare aligned horizontally, vertically or diagonally, and different motionvectors are allocated to the two subblocks into which the subblock isdivided, respectively. sub_mb_mode8 is the mode in which a subblock isdivided into four parts, and different motion vectors are allocated tothe four subblocks into which the subblock is divided, respectively.

The block dividing unit 2 divides each frame image of the inputted videosignal 1 inputted to the moving image encoding device into macroblockimages each having the macroblock size 4 notified thereto by theencoding controlling unit 3. In addition, when an encoding mode 7notified thereto from the encoding controlling unit 3 includes a mode(one of sub_mb_mode1 to 4 of FIG. 2A or one of sub_mb_mode1 tosub_mb_mode8 of FIG. 2B) in which different encoding modes arerespectively allocated to subblocks into which a macroblock is divided,the block dividing unit 2 divides each macroblock image into subblockimages shown by the encoding mode 7. Therefore, a block image outputtedfrom the block dividing unit 2 is either one of a macroblock image or asubblock image in accordance with the encoding mode 7. Hereafter, thisblock image is referred to as a macro/subblock image 5.

When each frame of the inputted video signal 1 has a horizontal orvertical size which is not an integral multiple of the horizontal sizeor vertical size of the macroblock size 4, a frame (extended frame) inwhich pixels are additionally provided in a horizontal or verticaldirection in such a way that each frame of the inputted video signal 1has a horizontal or vertical size which is an integral multiple of thehorizontal size or vertical size of the macroblock size is generated foreach frame of the inputted video signal 1. As a generation method ofgenerating pixels in the extended region when pixels are added to wideneach frame in, for example, a vertical direction, there is a method offilling the extended region by repeatedly copying a line of pixelsrunning on a lower edge of the original frame or by repeatedlygenerating a line of pixels having a fixed pixel value (gray, black,white, or the like). Also when pixels are added to widen each frame in ahorizontal direction, there is a method of filling the extended regionby repeatedly copying a line of pixels running on a right edge of theoriginal frame or by repeatedly generating a line of pixels having afixed pixel value (gray, black, white, or the like). The extended framewhich is generated for each frame of the inputted video signal 1 andwhose frame size is an integral multiple of the macroblock size, insteadof each frame image of the inputted video signal 1, is inputted to theblock dividing unit 2.

The macroblock size 4 and the frame size (horizontal size and verticalsize) of each frame of the inputted video signal 1 are outputted to thevariable length encoding unit 23 so as to be multiplexed into thebitstream in units of one sequence which consists of one or more framesor in units of one picture.

The value of the macroblock size can be alternatively defined by aprofile or the like, instead of being multiplexed directly into thebitstream. In this case, identification information for identifying theprofile on a per-sequence basis is multiplexed into the bitstream.

The switching unit 6 is a switch for switching between the inputdestinations of the macro/subblock image 5 in accordance with theencoding mode 7. When the encoding mode 7 is the mode in which themacro/subblock image is encoded by using an intra-frame prediction(referred to as the intra-frame prediction mode from here on), thisswitching unit 6 inputs the macro/subblock image 5 to theintra-prediction unit 8, whereas when the encoding mode 7 is the mode inwhich the macro/subblock image is encoded by using an inter-frameprediction (referred to as the inter-frame prediction mode from hereon), the switching unit inputs the macro/subblock image 5 to themotion-compensated prediction unit 9.

The intra-prediction unit 8 carries out an intra-frame prediction on themacro/subblock image 5 inputted thereto in units of one macro block tobe encoded having a size specified by the macroblock size 4 or in unitsof one subblock specified by the encoding mode 7. The intra-predictionunit 8 generates a prediction image 11 by using the image signal in theframe stored in the memory 28 for intra prediction for each of all intraprediction modes included in the prediction parameters 10 notifiedthereto from the encoding controlling unit 3.

Hereafter, the details of the prediction parameters 10 will beexplained. When the encoding mode 7 is the intra-frame prediction mode,the encoding controlling unit 3 specifies an intra prediction mode as aprediction parameter 10 corresponding to the encoding mode 7. As thisintra prediction mode, for example, there can be a mode in which themacroblock or subblock is divided into blocks of 4×4 pixels, and aprediction image is generated by using pixels in the vicinity of a unitblock of the image signal stored in the memory 28 for intra prediction,a mode in which the macroblock or subblock is divided into blocks of 8×8pixels, and a prediction image is generated by using pixels in thevicinity of a unit block of the image signal stored in the memory 28 forintra prediction, a mode in which the macroblock or subblock is dividedinto blocks of 16×16 pixels, and a prediction image is generated byusing pixels in the vicinity of a unit block of the image signal storedin the memory 28 for intra prediction, and a mode in which a predictionimage is generated from an image of a reduced inside of the macroblockor subblock.

The motion-compensated prediction unit 9 specifies a reference image 15which is used for the generation of a prediction image from the dataabout one or more frames of reference images stored in themotion-compensated prediction frame memory 14, and carries out amotion-compensated prediction by using this reference image 15 and themacro/subblock image 5 in accordance with the encoding mode 7 notifiedthereto from the encoding controlling unit 3 to generate predictionparameters 18 and a prediction image 17.

Hereafter, the details of the prediction parameters 18 will beexplained. When the encoding mode 7 is the inter frame prediction mode,the motion-compensated prediction unit 9 determines motion vectors andthe identification number (reference image index) or the like of thereference image indicated by each of the motion vectors as theprediction parameters 18 corresponding to the encoding mode 7. Thedetails of a generation method of generating prediction parameters 18will be mentioned later.

The subtraction unit 12 subtracts either one of the prediction image 11and the prediction image 17 from the macro/subblock image 5 to acquire aprediction difference signal 13. The prediction difference signal 13 isgenerated for each of all the prediction images 11 which theintra-prediction unit 8 generates in accordance with all the intraprediction modes specified by the prediction parameters 10.

The prediction difference signal 13 which is generated in accordancewith each of all the intra prediction modes specified by the predictionparameters 10 is evaluated by the encoding controlling unit 3, andoptimum prediction parameters 10 a including an optimum intra predictionmode are determined. As a method of evaluating the prediction differencesignal, the encoding controlling unit uses, for example, a method ofcalculating an encoding cost J₂, which will be mentioned below, by usingthe compressed data 21 generated by transforming and quantizing theprediction difference signal 13. The encoding controlling unit thenselects the intra prediction mode which minimizes the encoding cost J₂.

The encoding controlling unit 3 evaluates the prediction differencesignal 13 which is generated for each of all the modes included in theencoding modes 7 by either the intra-prediction unit 8 or themotion-compensated prediction unit 9, and determines an optimum encodingmode 7 a which provides an optimum degree of encoding efficiency fromamong the encoding modes 7 on the basis of the result of the evaluation.The encoding controlling unit 3 further determines optimum predictionparameters 10 a or 18 a and optimum compression parameters 20 acorresponding to the optimum encoding mode 7 a from the predictionparameters 10 or 18 and the compression parameters 20. A procedure ofdetermining the optimum prediction parameters and a procedure ofdetermining the optimum compression parameters will be mentioned later.As mentioned above, in the case of the intra-frame prediction mode, theintra prediction mode is included in the prediction parameters 10 and inthe optimum prediction parameters 10 a. In contrast, in the case of theinter frame prediction mode, motion vectors, the identification number(reference image index) of the reference image indicated by each of themotion vectors, etc. are included in the prediction parameters 18 and inthe optimum prediction parameters 18 a. Further, a transformation blocksize, a quantization step size, etc. are included in the compressionparameters 20 and in the optimum compression parameters 20 a.

As the result of carrying out this determining procedure, the encodingcontrolling unit 3 outputs the optimum encoding mode 7 a, the optimumprediction parameters 10 a or 18 a, and the optimum compressionparameters 20 a for the macro block or subblock to be encoded to thevariable length encoding unit 23. The encoding controlling unit 3 alsooutputs the optimum compression parameters 20 a of the compressionparameters 20 to the transformation/quantization unit 19 and to theinverse quantization/inverse transformation unit 22.

The transformation/quantization unit 19 selects the predictiondifference signal 13 (referred to as the optimum prediction differentialsignal 13 a from here on) which corresponds to the prediction image 11or 17 generated on the basis of the optimum encoding mode 7 a and theoptimum prediction parameters 10 a or 18 a which the encodingcontrolling unit 3 has determined from among the plurality of predictiondifference signals 13 which are respectively generated for all the modesincluded in the encoding modes 7, carries out a transforming process,such as a DCT, on this optimum prediction differential signal 13 a onthe basis of the transformation block size in the optimum compressionparameters 20 a determined by the encoding controlling unit 3 tocalculate transform coefficients and also quantizes these transformcoefficients on the basis of the quantization step size in the optimumcompression parameters 20 a notified thereto from the encodingcontrolling unit 3, and then outputs the compressed data 21 which arethe transform coefficients quantized thereby to the inversequantization/inverse transformation unit 22 and to the variable lengthencoding unit 23.

The inverse quantization/inverse transformation unit 22inverse-quantizes the compressed data 21 inputted thereto from thetransformation/quantization unit 19 by using the optimum compressionparameters 20 a and then carries out an inverse transformation process,such as an inverse DCT, to generate a local decoded predictiondifference signal 24 of the prediction difference signal 13 a, andoutputs this local decoded prediction difference signal 24 to the addingunit 25.

The adding unit 25 adds the local decoded prediction difference signal24 and the prediction image 11 or 17 to generate a local decoded imagesignal 26, and outputs this local decoded image signal 26 to the loopfilter unit 27 while storing the local decoded image signal in thememory 28 for intra prediction. This local decoded image signal 26serves as an image signal for intra-frame prediction.

The loop filter unit 27 carries out a predetermined filtering process onthe local decoded image signal 26 inputted thereto from the adding unit25, and stores the local decoded image 29 on which the loop filter unithas carried out the filtering process in the motion-compensatedprediction frame memory 14. This local decoded image 29 serves as areference image 15 for motion-compensated prediction. The filteringprocess by the loop filter unit 27 can be carried out in units of onemacro block of the local decoded image signal 26 inputted to the loopfilter unit, or can be carried out on one screenful of macro blocksafter the local decoded image signal 26 corresponding to the onescreenful of macro blocks are inputted to the loop filter unit.

The variable length encoding unit 23 entropy-encodes the compressed data21 outputted thereto from the transformation/quantization unit 19, theoptimum encoding mode 7 a outputted thereto from the encodingcontrolling unit 3, the optimum prediction parameters 10 a or 18 a, andthe optimum compression parameters 20 a to generate a bitstream 30showing the results of those encodings. The optimum predictionparameters 10 a or 18 a and the optimum compression parameters 20 a areencoded in units of one element in accordance with the encoding modeindicated by the optimum encoding mode 7 a.

As mentioned above, in the moving image encoding device in accordancewith this Embodiment 1, the motion-compensated prediction unit 9 and thetransformation/quantization unit 19 operate in cooperation with theencoding controlling unit 3 to determine the encoding mode, theprediction parameters, and the compression parameters which provide anoptimum degree of encoding efficiency (i.e. the optimum encoding mode 7a, the optimum prediction parameters 10 a or 18 a, and the optimumcompression parameters 20 a).

Hereafter, the determining procedure, which is carried out by theencoding controlling unit 3, for determining the encoding mode whichprovides an optimum degree of encoding efficiency, the predictionparameters, and the compression parameters will be explained in theorder of 1. the prediction parameters, 2. the compression parameters,and 3. the encoding mode.

1. Procedure for Determining the Prediction Parameters

Hereafter, a procedure for, when the encoding mode 7 is the inter frameprediction mode, determining the prediction parameters 18 includingmotion vectors related to the inter frame prediction, and theidentification number (reference image index) or the like of thereference image indicated by each of the motion vectors will beexplained.

The motion-compensated prediction unit 9 determines the predictionparameters 18 for each of all the encoding modes 7 (e.g. the set ofencoding modes shown in FIG. 2A or 2B) which are notified from theencoding controlling unit 3 to the motion compensation predicting unit9, in cooperation with the encoding controlling unit 3. Hereafter, thedetails of the procedure will be explained.

FIG. 3 is a block diagram showing the internal structure of themotion-compensated prediction unit 9. The motion-compensated predictionunit 9 shown in FIG. 3 includes a motion compensation region dividingunit 40, a motion detecting unit 42, and an interpolated imagegenerating unit 43. Further, input data inputted to themotion-compensated prediction unit include the encoding mode 7 inputtedthereto from the encoding controlling unit 3, the macro/subblock image 5inputted thereto from the switching unit 6, and the reference image 15inputted thereto from the motion-compensated prediction frame memory 14.

The motion compensation region dividing unit 40 divides themacro/subblock image 5 inputted from the switching unit 6 into images ofblocks each of which is a unit for motion compensation in accordancewith the encoding mode 7 notified thereto from the encoding controllingunit 3, and outputs this motion compensation region block image 41 tothe motion detecting unit 42.

The interpolated image generating unit 43 specifies the reference image15 which is used for the generation of a prediction image from the dataabout the one or more frames of reference images stored in themotion-compensated prediction frame memory 14, and the motion detectingunit 42 detects a motion vector 44 in a predetermined motion searchrange on the reference image 15 specified by the interpolated imagegenerating unit. The motion detecting unit carries out the detection ofthe motion vector by using a motion vector having virtual sampleaccuracy, like in the case of the MPEG-4 AVC standards or the like. Thisdetecting method includes the steps of, for pixel information (referredto as integer pixels) which the reference image has, generating virtualsamples (pixels) between integer pixels by implementing an interpolationarithmetic operation on the integer pixels, and using the virtualsamples as a prediction image. In the case of the MPEG-4 AVC standards,in accordance with the detecting method, virtual samples having ⅛-pixelaccuracy can be generated and used. In the case of the MPEG-4 AVCstandards, virtual samples having ½ pixel accuracy are generated byimplementing an interpolation arithmetic operation with a 6-tap filterusing six integer pixels running in a vertical or horizontal direction.Virtual samples having ¼ pixel accuracy are generated by implementing aninterpolation arithmetic operation using a filter for acquiring a meanvalue of adjacent ½ pixels or integer pixels.

Also in the motion-compensated prediction unit 9 in accordance with thisEmbodiment 1, the interpolated image generating unit 43 generates aprediction image 45 of virtual pixels in accordance with the accuracy ofthe motion vector 44 notified thereto from the motion detecting unit 42.Hereafter, an example of a detection procedure for detecting a motionvector having virtual pixel accuracy will be shown.

Motion Vector Detection Procedure I

The interpolated image generating unit 43 generates a prediction image45 for the motion vector 44 having integer pixel accuracy in thepredetermined motion search range of the motion compensation regionblock image 41. The prediction image 45 (prediction image 17) generatedat integer pixel accuracy is outputted to the subtraction unit 12 and issubtracted from the motion compensation region block image 41(macro/subblock image 5) by the subtraction unit 12, so that the resultof the subtraction is defined as a prediction difference signal 13. Theencoding controlling unit 3 evaluates a degree of prediction efficiencyfor the prediction difference signal 13 and for the motion vector 44(prediction parameter 18) having integer pixel accuracy. In theevaluation of the degree of prediction efficiency, a prediction cost J₁is calculated in accordance with, for example, the following equation(1), and the motion vector 44 having integer pixel accuracy whichminimizes the prediction cost J₁ in the predetermined motion searchrange is determined.

J ₁ =D ₁ +λR ₁  (1)

It is assumed that D₁ and R₁ are used as evaluated values. D₁ is the sumof absolute values (SAD) in the macroblock or subblock of the predictiondifference signal, R₁ is an estimated code amount of the motion vectorand the identification number of the reference image indicated by thismotion vector, and h is a positive number.

When determining the evaluated value R₁, the code amount of the motionvector is predicted by using the value of an adjacent motion vector asthe value of the motion vector in each mode shown in FIG. 2A or 2B, andthe prediction difference value is entropy-encoded on the basis of aprobability distribution. As an alternative, the evaluated value isdetermined by carrying out an estimation of a code amount correspondingto the evaluated value.

FIG. 4 is a view explaining a determining method of determining apredicted value of the motion vector (referred to as a predicted vectorfrom here on) in each encoding mode 7 shown in FIG. 2B. Referring toFIG. 4, for a rectangular block in mb_mode0, sub_mb_mode1, or the like,a predicted vector PMV of this rectangular block is calculated inaccordance with the following equation (2) by using already-encodedmotion vectors MVa, MVb, and MVc of blocks located on a left side(position A), an upper side (position B), and an upper right side(position C) of the rectangular block. median( ) corresponds to a medianfilter process and is a function of outputting the median of the motionvectors MVa, MVb, and MVc.

PMV=median(MVa,MVb,MVc)  (2)

In contrast, in the case of L-shaped blocks having an L-letter shapemb_mode1, sub_mb_mode2, mb_mode2, sub_mb_mode3, mb_mode3, sub_mb_mode4,mb_mode4, and sub_mb_mode5, the positions A, B, and C on which themedian is operated are changed in accordance with the L-letter shape inorder to make it possible to apply the same process as that performed onrectangular blocks to each L-shaped block. As a result, a predictedvalue of the motion vector can be calculated in accordance with theshape of each motion vector allocation region without changing themethod of calculating a predicted vector PMV, and the cost of theevaluated value R₁ can be reduced to a small one.

Motion Vector Detection Procedure II

The interpolated image generating unit 43 generates a prediction image45 for one or more motion vectors 44 having ½ pixel accuracy located inthe vicinity of the motion vector having integer pixel accuracy which isdetermined in accordance with the above-mentioned “motion vectordetection procedure I”. After that, in the same way that theabove-mentioned “motion vector detection procedure I” is carried out,the prediction image 45 (prediction image 17) generated at ½ pixelaccuracy is subtracted from the motion compensation region block image41 (macro/subblock image 5) by the subtraction unit 12, so that aprediction difference signal 13 is acquired. Next, the encodingcontrolling unit 3 evaluates a degree of prediction efficiency for thisprediction difference signal 13 and for the motion vector 44 (predictionparameter 18) having ½ pixel accuracy, and determines a motion vector 44having ½ pixel accuracy which minimizes the prediction cost J₁ from theone or more motion vectors having ½ pixel accuracy located in thevicinity of the motion vector having integer pixel accuracy.

Motion Vector Detection Procedure III

Also for motion vectors having ¼ pixel accuracy, the encodingcontrolling unit 3 and the motion-compensated prediction unit 9determine a motion vector 44 having ¼ pixel accuracy which minimizes theprediction cost J₁ from one or more motion vectors having ¼ pixelaccuracy located in the vicinity of the motion vector having ½ pixelaccuracy which is determined in accordance with the above-mentioned“motion vector detection procedure II”.

Motion Vector Detection Procedure IV

After that, the encoding controlling unit 3 and the motion-compensatedprediction unit 9 similarly detect a motion vector having virtual pixelaccuracy until the motion vector detected thereby has a predetermineddegree of accuracy.

Although in this embodiment, the example in which the encodingcontrolling unit and the motion-compensated prediction unit detect amotion vector having virtual pixel accuracy until the motion vectordetected thereby has a predetermined degree of accuracy is shown, thedetection of a motion vector having virtual pixel accuracy can beaborted when, for example, a threshold for the prediction cost ispredetermined and the prediction cost J₁ becomes smaller than thepredetermined threshold before the motion vector detected has apredetermined degree of accuracy.

The motion vector can be made to refer to a pixel located outside theframe defined by the reference frame size. In this case, it is necessaryto generate pixels located outside the frame. As a method of generatingpixels located outside the frame, there is a method of filling anoutside region with pixels running on a screen edge of the frame.

When the frame size of each frame of the inputted video signal 1 is notan integral multiple of macroblock size and an extended frame isinputted instead of each frame of the inputted video signal 1, the sizewhich is extended to an integral multiple of the macroblock size (thesize of the extended frame) is defined as the frame size of thereference frame. In contrast, when the local decoded portion of theextended region is not referred to, but only the local decoded portionof the original frame is referred to as pixels in the frame, the framesize of the original inputted video signal is defined as the frame sizeof the reference frame.

For the motion compensation region block image 41 of each of a pluralityof bocks into which the macro/subblock image 5 is divided and which is aunit for the motion compensation indicated by the encoding mode 7, themotion-compensated prediction unit 9 outputs both the virtual pixelaccurate motion vector having a predetermined degree of accuracy whichis determined for the motion compensation region block image, and theidentification number of the reference image indicated by the motionvector as the prediction parameters 18. The motion-compensatedprediction unit 9 also outputs the prediction image 45 (prediction image17) generated using the prediction parameters 18 to the subtraction unit12, and the prediction image is subtracted from the macro/subblock image5 by the subtraction unit 12, so that a prediction difference signal 13is acquired. The prediction difference signal 13 outputted from thesubtraction unit 12 is outputted to the transformation/quantization unit19.

2. Determining Procedure for Determining the Compression Parameters

Hereafter, the procedure for determining a compression parameter 20(transformation block size) which is used when carrying out atransformation and quantization process on the prediction differencesignal 13 generated on the basis of the prediction parameters 18determined for each encoding mode 7 in accordance with theabove-mentioned “1. Determining procedure for determining the predictionparameters” will be explained.

FIG. 5 is a view showing an example of adaptation of the transformationblock size in accordance with an encoding mode 7 shown in FIG. 2B.Referring to FIG. 5, a block of 32×32 pixels is used as an example of ablock of M×L pixels. When the mode indicated by the encoding mode 7 isone of mb_mode0 to mb_mode6, either the size of 16×16 pixels or the sizeof 8×8 pixels is adaptively selectable as the transformation block size.When the encoding mode 7 indicates mb_mode7, either the size of 8×8pixels or the size of 4×4 pixels is adaptively selectable as thetransformation block size for each of 16×16 pixel subblocks into whicheach macroblock is divided. The set of selectable transformation blocksizes for each encoding mode can be defined from among arbitraryrectangular block sizes each of which is equal to or smaller than thesize of equal subblocks into which a macroblock is divided in accordancewith the encoding mode.

FIG. 6 is a view showing another example of the adaptation of thetransformation block size in accordance with an encoding mode 7 shown inFIG. 2B. In the example of FIG. 6, when the mode indicated by theencoding mode 7 is the above-mentioned mb_mode0, mb_mode5, or mb_mode6,in addition to the size of 16×16 pixels and the size of 8×8 pixels, thetransformation block size in accordance with the shape of each subblockwhich is a unit for the motion compensation is selectable as aselectable transformation block size. In the case of mb_mode0, thetransformation block size is adaptively selectable from among the sizeof 16×16 pixels, the size of 8×8 pixels, and the size of 32×32 pixels.In the case of mb_mode5, the transformation block size is adaptivelyselectable from among the size of 16×16 pixels, the size of 8×8 pixels,and the size of 16×32 pixels. In the case of mb_mode6, thetransformation block size is adaptively selectable from among the sizeof 16×16 pixels, the size of 8×8 pixels, and the size of 32×16 pixels.Further, although not illustrated, in the case of mb_mode7, thetransformation block size is adaptively selectable from among the sizeof 16×16 pixels, the size of 8×8 pixels, and the size of 16×32 pixels.In the case of one of mb_mode1 to mb_mode4, the adaptation can becarried out in such a way that the transformation block size is selectedfrom the size of 16×16 pixels and the size of 8×8 pixels for a regionwhich is not a rectangle, while the transformation block size isselected from the size of 8×8 pixels and the size of 4×4 pixels for aregion which is a rectangle.

The encoding controlling unit 3 defines the set of transformation blocksizes in accordance with the encoding mode 7 illustrated in FIGS. 5 and6 as a compression parameter 20. Although in the examples shown in FIGS.5 and 6, the set of selectable transformation block sizes is determinedin advance in accordance with the encoding mode 7 of each macroblock,and a transformation block size can be selected adaptively for eachmacroblock or subblock, the set of selectable transformation block sizescan be alternatively determined in advance in accordance with theencoding mode 7 (one of sub_mb_mode1 to sub_mb_mode8 shown in FIG. 2B)of each of subblocks into which each macroblock is similarly divided,and a transformation block size can be selected adaptively for each ofthe subblocks or each of blocks into which each subblock is furtherdivided. Similarly, when an encoding mode 7 shown in FIG. 2A is used,the encoding controlling unit 3 can determine the set of transformationblock sizes in accordance with the encoding mode 7 in advance, and canadaptively select a transformation block size from the set.

The transformation/quantization unit 19 determines an optimumtransformation block size from the transformation block sizes in unitsof one macroblock having a size specified by the macroblock size 4 or inunits of one of subblocks into which each macroblock is further dividedin accordance with the encoding mode 7, in cooperation with the encodingcontrolling unit 3. Hereafter, the details of a procedure fordetermining an optimum transformation block size will be explained.

FIG. 7 is a block diagram showing the internal structure of thetransformation/quantization unit 19. The transformation/quantizationunit 19 shown in FIG. 7 includes a transformation block size dividingunit 50, a transforming unit 52, and a quantizing unit 54. Further,input data inputted to the transformation/quantization unit include thecompression parameters 20 (the transformation block size, thequantization step size, etc.) inputted thereto from the encodingcontrolling unit 3 and the prediction difference signal 13 inputtedthereto from the encoding controlling unit 3.

The transformation block size dividing unit 50 converts the predictiondifference signal 13 of each macroblock or subblock which is the targetfor determination of the transformation block size into blocks inaccordance with the transformation block size in the compressionparameters 20, and outputs each of the blocks to the transforming unit52 as a transformation target block 51. When a plurality oftransformation block sizes are selected and specified for one macroblockor subblock by the compression parameters 20, the plurality oftransformation block sizes of transformation target blocks 51 aresequentially outputted to the transforming unit 52.

The transforming unit 52 carries out a DCT, an integer transformation inwhich the transform coefficients of a DCT are approximated by integers,and a transforming process in accordance with a transforming method,such as Hadamard transform, on the transformation object block 51inputted thereto to generate transform coefficients 53, and outputs thetransform coefficients 53 generated thereby to the quantizing unit 54.

The quantizing unit 54 quantizes the transform coefficients 53 inputtedthereto in accordance with the quantization step size in the compressionparameters 20 notified thereto from the encoding controlling unit 3, andoutputs compressed data 21 which are the transform coefficientsquantized to the inverse quantization/inverse transformation unit 22 andto the encoding controlling unit 3. When a plurality of transformationblock sizes are selected and specified for one macroblock or subblock bythe compression parameters 20, the transforming unit 52 and thequantizing unit 54 carry out the above-mentioned transformation andquantization process on all the transformation block sizes oftransformation target blocks, and outputs the compressed data 21associated with each of all the transformation block sizes.

The compressed data 21 outputted from the quantizing unit 54 areinputted to the encoding controlling unit 3, and are used for theevaluation of a degree of encoding efficiency for the transformationblock size in the compression parameters 20. The encoding controllingunit 3 uses the compressed data 21 acquired for each of all theselectable transformation block sizes in each encoding mode included inthe encoding modes 7 to calculate an encoding cost J₂ in accordancewith, for example, the following equation (3), and to select thetransformation block size which minimizes the encoding cost J₂ fromamong the selectable transformation block sizes.

J ₂ =D ₂ +λR ₂  (3)

It is assumed that D₂ and R₂ are used as evaluated values. As D₂, thedistortion sum of squared differences or the like between the localdecoded image signal 26, which is acquired by inputting the compresseddata 21 acquired for the transformation block size to the inversequantization/inverse transformation unit 22, and adding the predictionimage 17 to a local decoded prediction difference signal 24 which isacquired by carrying out an inverse transformation and inversequantization process on the compressed data 21, and the macro/subblockimage 5 can be used. As R₂, the code amount (or estimated code amount)acquired by actually encoding the compressed data 21 acquired for thetransformation block size, and the encoding mode 7 and the predictionparameters 10 or 18 associated with the compressed data 21 by means ofthe variable length encoding unit 23 is used.

After determining the optimum encoding mode 7 a in accordance with “3.Determining procedure for determining the encoding mode” which will bementioned below, the encoding controlling unit 3 selects thetransformation block size corresponding to the determined optimumencoding mode 7 a and includes the transformation block size in theoptimum compression parameters 20 a, and then outputs the optimumcompression parameters to the variable length encoding unit 23. Afterentropy-encoding these optimum compression parameters 20 a, the variablelength encoding unit 23 multiplexes the optimum compression parametersentropy-encoded thereby into the bitstream 30.

Because the transformation block size is selected from among the set oftransformation block sizes (illustrated in FIGS. 5 and 6) which aredefined in advance in accordance with the optimum encoding mode 7 a ofthe macroblock or subblock, what is necessary is just to assignidentification information, such as an ID, to each transformation blocksize included in each set of transformation block sizes, entropy-encodethe identification information as information about the transformationblock size, and multiplex the identification information into thebitstream 30. In this case, the identification information of each setof transformation block sizes is set up in advance in the decodingdevice. However, because the decoding device can determine thetransformation block size automatically from the set of transformationblock sizes when only one transformation block size is included in theset of transformation block sizes, the encoding device does not have tomultiplex the identification information of the transformation blocksize into the bitstream 30.

3. Determining Procedure of Determining the Encoding Mode

After the prediction parameters 10 or 18 and the compression parameters20 for each of all the encoding modes 7 specified by the encodingcontrolling unit 3 are determined in accordance with the above-mentioned“1. Determining procedure for determining the prediction parameters”,and “2. Determining procedure for determining the compressionparameters”, the encoding controlling unit 3 uses the compressed data 21which are acquired by further transforming and quantizing the predictiondifference signal 13 which is acquired by using each of the encodingmodes 7, and the prediction parameters 10 or 18 and the compressionparameters 20 in that encoding mode to determine the encoding mode 7which reduces the encoding cost J₂ to a minimum in accordance with theabove-mentioned equation (3), and selects the encoding mode 7 as theoptimum encoding mode 7 a of the macroblock currently being processed.

As an alternative, the encoding controlling unit can determine theoptimum encoding mode 7 a from among all the encoding modes including askip mode as a mode of the macroblock or subblock in addition to theencoding modes shown in FIGS. 2A 2B. The skip mode is the mode in whicha prediction image on which motion compensation is carried out by usingthe motion vector of an adjacent macroblock or subblock is defined asthe local decoded image signal in the encoding device. Because it is notnecessary to calculate the prediction parameters other than the encodingmodes, and the compression parameters to multiplex them into thebitstream, the inputted image can be encoded while the code amount issuppressed. The decoding device outputs the prediction image on whichmotion compensation is carried out by using the motion vector of anadjacent macroblock or subblock in accordance with the same procedure asthat carried out by the encoding device as the decoded image signal.

When the frame size of each frame of the inputted video signal 1 is notan integral multiple of the macroblock size and an extended frame isinputted instead of each frame of the inputted video signal 1, a controloperation of selecting only the skip mode for a macroblock or subblockincluding an extended region can be carried out, and an encoding modecan be determined in such a way that the code amount spent on theextended region can be suppressed.

The encoding controlling unit 3 outputs the optimum encoding mode 7 aproviding the optimum degree of encoding efficiency which is determinedin accordance with the above-mentioned “1. Determining procedure fordetermining the prediction parameters”, “2. Determining procedure fordetermining the compression parameters”, and “3. Determining procedurefor determining the encoding mode” to the variable length encoding unit23, while selecting the prediction parameters 10 or 18 corresponding tothe optimum encoding mode 7 a as the optimum prediction parameters 10 aor 18 a and similarly selecting the compression parameters 20corresponding to the optimum encoding mode 7 a as the optimumcompression parameters 20 a, and then outputting these optimumprediction and compression parameters to the variable length encodingunit 23. The variable length encoding unit 23 entropy-encodes theoptimum encoding mode 7 a, the optimum prediction parameters 10 a or 18a, and the optimum compression parameters 20 a, and then multiplexesthem into the bitstream 30.

Further, the optimum prediction differential signal 13 a acquired fromthe prediction image 11 or 17 based on the optimum encoding mode 7 a,the optimum prediction parameters 10 a or 18 a, and the optimumcompression parameter 20 a which are determined as above is transformedand quantized into compressed data 21 by the transformation/quantizationunit 19, as mentioned above, and these compressed data 21 areentropy-encoded by the variable length encoding unit 23 and aremultiplexed into the bitstream 30. Further, these compressed data 21 aremade to pass via the inverse quantization/inverse transformation unit 22and the adding unit 25, and then become a local decoded image signal 26and are inputted to the loop filter unit 27.

Next, the moving image decoding device in accordance with thisEmbodiment 1 will be explained. FIG. 8 is a block diagram showing thestructure of the moving image decoding device in accordance withEmbodiment 1 of the present invention. The moving image decoding deviceshown in FIG. 8 includes a variable length decoding unit 61 forentropy-decoding the optimum encoding mode 62 multiplexed into thebitstream 60 in units of one macroblock to while entropy-decoding theoptimum prediction parameters 63, the compressed data 64, and theoptimum compression parameters 65 from the bitstream 60 in units of onemacroblock or subblock divided in accordance with the decoded optimumencoding mode 62, an intra-prediction unit 69 for, when the optimumprediction parameters 63 are inputted, generating a prediction image 71by using the intra prediction mode included in the optimum predictionparameters 63, and a decoded image 74 a stored in a memory 77 for intraprediction, a motion-compensated prediction unit 70 for, when theoptimum prediction parameters 63 are inputted, carrying out amotion-compensated prediction by using the motion vector included in theoptimum prediction parameters 63, and the reference image 76 in amotion-compensated prediction frame memory 75 which is specified by thereference image index included in the optimum prediction parameters 63to generate a prediction image 72, a switching unit 68 for inputting theoptimum prediction parameters 63 which the variable length decoding unit61 has decoded to either one of the intra-prediction unit 69 and themotion-compensated prediction unit 70 in accordance with the decodedoptimum encoding mode 62, an inverse quantization/inverse transformationunit 66 for carrying out an inverse quantization and inversetransformation process on the compressed data 64 by using the optimumcompression parameters 65 to generate prediction difference signaldecoded values 67, an adding unit 73 for adding the prediction image 71or 72 outputted from either one of the intra-prediction unit 69 and themotion-compensated prediction unit 70 to the prediction differencesignal decoded values 67 to generate a decoded image 74, the memory 77for intra prediction for storing the decoded image 74, a loop filterunit 78 for carrying out filtering on the decoded image 74 to generate areproduced image 79, and the motion-compensated prediction frame memory75 for storing the reproduced image 79.

When the moving image decoding device in accordance with this Embodiment1 receives the bitstream 60, the variable length decoding unit 61carries out an entropy decoding process on the bitstream 60 to acquirethe macroblock size and the frame size in units of one sequence whichconsists of one or more frames of pictures or in units of one picture.In a case in which the macroblock size is defined by a profile or thelike without being multiplexed directly into the bitstream, themacroblock size is determined on the basis of the identificationinformation of the profile which is decoded from the bitstream in unitsof one sequence. The number of macroblocks included in each frame isdetermined on the basis of the decoded macroblock size of each frame andthe decoded frame size, and the optimum encoding mode 62, the optimumprediction parameters 63, the compressed data 64 (i.e. quantized andtransformed coefficient data), the optimum compression parameters 65(the transformation block size information and the quantization stepsize), etc. of each macroblock included in the frame are decoded. Theoptimum encoding mode 62, the optimum prediction parameters 63, thecompressed data 64, and the optimum compression parameters 65 which aredecoded by the decoding device correspond to the optimum encoding mode 7a, the optimum prediction parameters 10 a or 18 a, the compressed data21, and the optimum compression parameters 20 a which are encoded by theencoding device, respectively.

At this time, because the transformation block size information in theoptimum compression parameters 65 is the identification information foridentifying the transformation block size which has been selected fromthe set of transformation block sizes defined in advance for eachmacroblock or subblock (or on a per-macroblock or per-subblock basis) inaccordance with the encoding mode 7 by the encoding device, the decodingdevice specifies the transformation block size of the macroblock orsubblock from the optimum encoding mode 62 and the transformation blocksize information in the optimum compression parameters 65.

The inverse quantization/inverse transformation unit 66 carries out aninverse quantization and inverse transformation process by using thecompressed data 64 and the optimum compression parameters 65 which areinputted from the variable length decoding unit 61 in units of one blockwhose size is specified by the transformation block size information tocalculate prediction difference signal decoded values 67.

Further, when decoding the motion vector, the variable length decodingunit 61 refers to the motion vectors of already-decoded peripheralblocks, and determines a predicted vector by carrying out a processshown in FIG. 4 to acquire a decoded value of the motion vector byadding the prediction difference values decoded from the bitstream 60 tothe predicted vector. The variable length decoding unit 61 includes thedecoded value of this motion vector in the optimum prediction parameters63, and outputs these optimum prediction parameters to the switchingunit 68.

The switching unit 68 is a switch for switching between the inputdestinations of the optimum prediction parameters 63 in accordance withthe optimum encoding mode 62. When the optimum encoding mode 62 inputtedfrom the variable length decoding unit 61 shows the intra-frameprediction mode, this switching unit 68 outputs the optimum predictionparameters 63 (intra prediction mode) similarly inputted from thevariable length decoding unit 61 to the intra-prediction unit 69,whereas when the optimum encoding mode 62 shows the inter frameprediction mode, the switching unit outputs the optimum predictionparameters 63 (the motion vectors, the identification number (referenceimage index) of the reference image indicated by each of the motionvectors, etc.) to the motion-compensated prediction unit 70.

The intra-prediction unit 69 refers to the decoded image 74 a in theframe stored in the memory 77 for intra prediction (decoded image signalin the frame), and generates and outputs a prediction image 71corresponding to the intra prediction mode indicated by the optimumprediction parameters 63.

Although a generation method of generating a prediction image 71 whichthe intra-prediction unit 69 uses is the same as the operation carriedout by the intra-prediction unit 8 in the encoding device, theintra-prediction unit 8 generates a prediction image 11 corresponding toeach of all the intra prediction modes indicated by the encoding modes7, while the intra-prediction unit 69 differs from the intra-predictionunit 8 in that the intra-prediction unit 69 generates only a predictionimage 71 corresponding to the intra prediction mode indicated by theoptimum encoding mode 62.

The motion-compensated prediction unit 70 generates a prediction image72 from the one or more frames of reference images 76 stored in themotion-compensated prediction frame memory 75 on the basis of the motionvector, the reference image index, and so on which are indicated by theinputted optimum prediction parameters 63, and outputs the predictionimage 72.

A generation method of generating a prediction image 72 which isimplemented by the motion-compensated prediction unit 70 corresponds tothe operation of the motion-compensated prediction unit 9 in theencoding device from which the process of searching through a pluralityof reference images for motion vectors (corresponding to the operationsof the motion detecting unit 42 and the interpolated image generatingunit 43 shown in FIG. 3) is excluded. The motion-compensated predictionunit carries out only the process of generating a prediction image 72 inaccordance with the optimum prediction parameters 63 provided theretofrom the variable length decoding unit 61. When the motion vector ismade to refer to a pixel located outside the frame which is defined bythe reference frame size, the motion-compensated prediction unit 70generates a prediction image 72 by using, for example, a method offilling a pixel region located outside the frame with pixels running ona screen edge of the frame, like that of the encoding device. Thereference frame size can be defined by the decoded frame size which isextended in such a way as to be an integral multiple of the decodedmacroblock size, or can be defined by the decoded frame size, and thedecoding device determines the reference frame size in accordance withthe same procedure as that carried out by the encoding device.

The adding unit 73 adds either one of the prediction image 71 and theprediction image 72 and the prediction difference signal decoded values67 outputted thereto from the inverse quantization/inversetransformation unit 66 to generate a decoded image 74.

While this decoded image 74 is stored in the memory 77 for intraprediction in order to use the decoded image as a reference image(decoded image 74 a) for generation of an intra prediction image for asubsequent macroblock, the decoded image 74 is inputted to the loopfilter unit 78.

The loop filter unit 78 carries out the same operation as that of theloop filter unit 27 in the encoding device to generate a reproducedimage 79, and outputs this reproduced image to outside the moving imagedecoding device. Further, this reproduced image 79 is stored in themotion-compensated prediction frame memory 75 in order to use thereproduced image as a reference image 76 for subsequent generation of aprediction image. The size of the reproduced image acquired afterdecoding all the macroblocks in the frame is an integral multiple of themacroblock size. When the size of the reproduced image is larger thanthe decoded frame size corresponding to the frame size of each frame ofthe video signal inputted to the encoding device, an extended regionwhich is extended in a horizontal or vertical direction is included inthe reproduced image. In this case, a decoded image in which the decodedimage of the extended region is removed from the reproduced image isoutputted from the decoding device.

When the reference frame size is defined by the decoded frame size, thedecoded image of the extended region of the reproduced image stored inthe motion-compensated prediction frame memory 75 is not referred to forsubsequent generation of a prediction image. Therefore, the decodedimage in which the decoded image of the extended region is removed fromthe reproduced image can be stored in the motion-compensated predictionframe memory 75.

As mentioned above, because the moving image encoding device inaccordance with Embodiment 1 is constructed in such a way that for eachof macro/subblock images 5 into which an inputted moving image isdivided in accordance with the encoding mode 7 of each macroblock, themoving image encoding device predetermines a set of transformationblocks including a plurality of transformation block sizes in accordancewith the size of a macroblock or subblock, the encoding controlling unit3 selects one transformation block size which provides an optimum degreeof encoding efficiency from the set of transformation block sizes andincludes the transformation block size selected thereby in optimumcompression parameters 20 a, and then notifies these optimum compressionparameters to the transformation/quantization unit 19, and thetransformation/quantization unit 19 divides an optimum predictiondifferential signal 13 a into blocks each having the transformationblock size included in the optimum compression parameters 20 a, andcarries out a transformation and quantization process on each of theblocks to generate compressed data 21, the moving image encoding devicecan improve the quality of the encoded video with a similar code amountas compared with a conventional method of using a fixed set oftransformation block sizes irrespective of the size of a macroblock orsubblock.

Further, while the variable length encoding unit 23 is constructed insuch a way as to multiplex the transformation block size which isadaptively selected in accordance with the encoding mode 7 from the setof transformation block sizes into the bitstream 30, the moving imagedecoding device in accordance with Embodiment 1 is constructed in such away that the variable length decoding unit 61 decodes the optimumcompression parameters 65 from the bitstream 60 in units of onemacroblock or subblock (or on a per-macroblock or per-subblock basis),and the inverse quantization/inverse transformation unit 66 determines atransformation block size on the basis of the transformation block sizeinformation included in these optimum compression parameters 65 andcarries out an inverse transformation and inverse quantization processon the compressed data 64 in units of one block having thetransformation block size. Therefore, because the moving image decodingdevice can select the transformation block size which has been used bythe encoding device from the set of transformation block sizes which isdefined in the same way that the set of transformation block sizes isdefined by the moving image encoding device to decode the compresseddata, the moving image decoding device can correctly decode thebitstream encoded by the moving image encoding device in accordance withEmbodiment 1.

Embodiment 2

In this Embodiment 2, a variant of the variable length encoding unit 23of the moving image encoding device in accordance with above-mentionedEmbodiment 1 will be explained, and a variant of the variable lengthdecoding unit 61 of the moving image decoding device in accordance withabove-mentioned Embodiment 1 will be explained similarly.

First, a variable length encoding unit 23 of a moving image encodingdevice in accordance with this Embodiment 2 will be explained. FIG. 9 isa block diagram showing the internal structure of the variable lengthencoding unit 23 of the moving image encoding device in accordance withEmbodiment 2 of the present invention. In FIG. 9, the same components asthose shown in FIG. 1 or like components are designated by the samereference numerals as those shown in the figure, and the explanation ofthe components will be omitted hereafter. Further, because the structureof the moving image encoding device in accordance with this Embodiment 2is the same as that in accordance with above-mentioned Embodiment 1, andthe operation of each component except the variable length encoding unit23 is the same as that in accordance with above-mentioned Embodiment 1,an explanation will be made by using FIGS. 1 to 8. Further, for the sakeof simplicity, although it is assumed hereafter that the moving imageencoding device in accordance with this Embodiment 2 has a structure anda processing method based on the use of the set of encoding modes shownin FIG. 2A, it is needless to say that Embodiment 2 can also be appliedto a structure and a processing method based on the use of the set ofencoding modes shown in FIG. 2B.

The variable length encoding unit 23 shown in FIG. 9 includes abinarization table memory 105 for storing a binarization tableindicating a correspondence between index values which a multi valuedsignal showing an encoding mode 7 (or an optimum prediction parameter 10a or 18 a, or an optimum compression parameter 20 a) can have, andbinary signals, a binarizing unit 92 for using this binarization tableto convert an optimum encoding mode 7 a (or an optimum predictionparameter 10 a or 18 a, or an optimum compression parameter 20 a) shownby the multi valued signal which is selected by an encoding controllingunit 3 into a binary signal 103, an arithmetic encoding processingoperation unit 104 for referring to context identification information102 which is generated by a context generating unit 99, a contextinformation memory 96, a probability table memory 97, and a statetransition table memory 98 to carry out arithmetic encoding on thebinary signal 103 into which the optimum encoding mode is converted bythe binarizing unit 92 and output an encoded bit sequence 111, and formultiplexing this encoded bit sequence 111 into a bitstream 30, afrequency information generating unit 93 for counting the frequency ofoccurrence of the optimum encoding mode 7 a (or an optimum predictionparameter 10 a or 18 a, or an optimum compression parameter 20 a) togenerate frequency information 94, and a binarization table updatingunit 95 for updating the correspondence between possible values of themulti valued signal and binary signals in the binarization table storedin the binarization table memory 105 on the basis of the frequencyinformation 94.

Hereafter, a variable length encoding procedure carried out by thevariable length encoding unit 23 will be explained by taking the optimumencoding mode 7 a of a macroblock outputted from the encodingcontrolling unit 3 as an example of a parameter to be entropy-encoded.An optimum prediction parameter 10 a or 18 a, or an optimum compressionparameter 20 a, which is similarly a parameter to be encoded, can bevariable-length-encoded in accordance with the same procedure as that inaccordance with which the variable length encoding unit encodes theoptimum encoding mode 7 a, the explanation of the procedure carried outon an optimum prediction parameter or an optimum compression parameterwill be omitted hereafter.

The encoding controlling unit 3 in accordance with this Embodiment 2outputs a context information initialization flag 91, a type indicatingsignal 100, peripheral block information 101, and a binarization tableupdate flag 113. The details of each of the pieces of information willbe mentioned later.

An initializing unit 90 initializes context information 106 stored inthe context information memory 96 in accordance with the contextinformation initialization flag 91 notified thereto from the encodingcontrolling unit 3 to place the context information 106 in its initialstate. The details of the initialization process carried out by theinitializing unit 90 will be mentioned later.

The binarizing unit 92 refers to the binarization table stored in thebinarization table memory 105 to convert the index value of the multivalued signal showing the type of the optimum encoding mode 7 a inputtedthereto from the encoding controlling unit 3 into a binary signal 103,and outputs this binary signal to the arithmetic encoding processingoperation unit 104.

FIG. 10 is a view showing an example of the binarization table held bythe binarization table memory 105. In an “encoding mode” column shown inFIG. 10, there are five types of encoding modes 7 including a skip mode(mb_skip: a mode in which the decoding device uses a prediction image,on which the motion compensation has been carried out by using themotion vectors of adjacent macroblocks by the encoding device, for adecoded image) in addition to the encoding modes (mb_mode0 to mb_mode3)shown in FIG. 2A. An “index” value corresponding to each of the encodingmodes is stored in the binarization table. Further, the index value ofeach of these encoding modes is binarized into a binary number havingone or three bits, and is stored as a “binary signal”. In this case,each bit of the binary signal is referred to as a “bin” number. Althoughmentioned later in detail, in the example of FIG. 10, a smaller indexvalue is assigned to an encoding mode having a higher frequency ofoccurrence, and a corresponding binary signal is also set to be short inlength, i.e. 1 bit in length.

The optimum encoding mode 7 a outputted from the encoding controllingunit 3 is inputted to the binarizing unit 92, and is also inputted tothe frequency information generating unit 93.

The frequency information generating unit 93 counts the frequency ofoccurrence of the index value of the encoding mode included in thisoptimum encoding mode 7 a (the frequency of selection of the encodingmode which the encoding controlling unit has selected) to generatefrequency information 94, and outputs this frequency information to thebinarization table updating unit 95 which will be mentioned later.

The probability table memory 97 holds a table for storing two or moresets of one symbol (MPS: Most Probable Symbol) having a higherprobability of occurrence of the symbol values “0” and “1” in each binincluded in the binary signal 103, and the probability of occurrence ofthe symbol.

FIG. 11 is a view showing an example of a probability table held by theprobability table memory 97. Referring to FIG. 11, a “probability tablenumber” is assigned to each of discrete probability values ranging from0.5 to 1.0 (“probabilities of occurrence”).

The state transition table memory 98 holds a table for storing aplurality of sets each having a “probability table number” stored in theprobability table memory 97, and a state transition from a probabilitystate in which the MPS of “0” or “1”, which is shown by the probabilitytable number, has not been encoded to a probability state in which theMPS of “0” or “1” has been encoded.

FIG. 12 is a view showing an example of a state transition table held bythe state transition table memory 98. Each set of a “probability tablenumber”, a “probability transition after LPS is encoded”, and a“probability transition after MPS is encoded”, which are shown in FIG.12, corresponds to a probability table number shown in FIG. 11. Forexample, this figure shows that at the time of a probability statehaving the “probability table number 1” enclosed by a box shown in FIG.12 (at the time that the probability of occurrence of the MPS is 0.527,as shown in FIG. 11), the encoding of one symbol having a lowerprobability of occurrence (LPS: Least Probable Symbol) of “0” and “1”causes the probability state to make a transition to the one having theprobability table number 0 (the probability of occurrence of the MPS is0.500, as shown in FIG. 11), as can be seen from the “probabilitytransition after LPS is encoded”. More specifically, because the LPSoccurs, the probability of occurrence of the MPS becomes small. Incontrast with this, the figure shows that the encoding of the MPS causesthe probability state to make a transition to the one having theprobability table number 2 (the probability of occurrence of the MPS is0.550, as shown in FIG. 11), as can be seen from the “probabilitytransition after MPS is encoded”. More specifically, because the MPSoccurs, the probability of occurrence of the MPS becomes large.

The context generating unit 99 refers to the type indicating signal 100indicating the type of the parameter to be encoded (the optimum encodingmode 7 a, an optimum prediction parameter 10 a or 18 a, or an optimumcompression parameter 20 a) which is inputted from the encodingcontrolling unit 3, and the peripheral block information 101 to generatecontext identification information 102 for each bin of the binary signal103 acquired by carrying out binarization on the parameter to beencoded. In this explanation, the type indicating signal 100 indicatesthe optimum encoding mode 7 a of the macroblock to be encoded. Further,the peripheral block information 101 indicates the optimum encodingmodes 7 a of macroblocks adjacent to the macroblock to be encoded.Hereafter, a generation procedure for generating the contextidentification information which is carried out the context generatingunit 99 will be explained.

FIG. 13(a) is a view showing the binarization table shown in FIG. 10 inbinary tree representation. Hereafter, an explanation will be made bytaking a macroblock to be encoded denoted by a thick-bordered box shownin FIG. 13(b) and peripheral blocks A and B which are adjacent to thismacroblock to be encoded as an example. In FIG. 13(a), each black dot isreferred to as a node, and each line which connects between nodes isreferred to as a path. The indexes of the multi valued signal to bebinarized are assigned to the terminal nodes of the binary tree,respectively. Further, the position of each node in a direction of thedepth of the binary tree, which is extending downwardly from an upperpart to a lower part on the page, corresponds to its bin number, and abit sequence which is acquired by connecting the symbols (each 0 or 1)respectively assigned to paths extending from the root node to eachterminal node shows a binary signal 103 corresponding to the index ofthe multi valued signal assigned to the terminal node. For each parentnode (a node which is not any terminal node) of the binary tree, one ormore pieces of context identification information are prepared inaccordance with the information about the peripheral blocks A and B.

For example, when three pieces of context identification information C0,C1, and C2 are prepared for the root node in the example of FIG. 13(a),the context generating unit 99 refers to the pieces of peripheral blockinformation 101 about the adjacent peripheral blocks A and B to selecteither one of the three pieces of context identification information C0,C1, and C2 in accordance with the following equation (4). The contextgenerating unit 99 outputs the selected context identificationinformation as the context identification information 102.

$\begin{matrix}{{\Gamma (X)} = \left\{ {\begin{matrix}0 & \left( {{when}\mspace{14mu} {encoding}{\mspace{11mu} \;}{mode}\mspace{14mu} {of}\mspace{14mu} {macroblock}\mspace{14mu} X\mspace{14mu} {is}\mspace{14mu} {not}\mspace{14mu} {zero}} \right) \\1 & \left( {{when}\mspace{14mu} {encoding}{\mspace{11mu} \;}{mode}\mspace{14mu} {of}\mspace{14mu} {macroblock}\mspace{14mu} X\mspace{14mu} {is}\mspace{14mu} {zero}} \right)\end{matrix}\mspace{20mu} \left\{ \begin{matrix}{{{C\; 0\text{:}\mspace{14mu} {\Gamma (A)}} + {\Gamma (B)}} = 0} \\{{{C\; 1\text{:}\mspace{14mu} {\Gamma (A)}} + {\Gamma (B)}} = 1} \\{{{C\; 2\text{:}\mspace{14mu} {\Gamma (A)}} + {\Gamma (B)}} = 2}\end{matrix} \right.} \right.} & (4)\end{matrix}$

The above equation (4) is prepared on the assumption that when each ofthe peripheral blocks A and B is defined as a macroblock X, there is ahigh probability that the encoding mode of the macroblock to be encodedis “0” (mb_skip) when the encoding mode of each of the peripheral blocksA and B is “0” (mb_skip). Therefore, the context identificationinformation 102 selected in accordance with the above equation (4) isbased on the same assumption.

One context identification information (C3, C4, or C5) is assigned toeach of the parent nodes other than the root node.

The context information identified by the context identificationinformation 102 holds the value (0 or 1) of the MPS and the probabilitytable number which approximates the probability of occurrence of thevalue. Now, the context information is placed in its initial state. Thecontext information memory 96 stores this context information.

The arithmetic encoding processing operation unit 104 carries outarithmetic encoding on each bin of the binary signal 103 with one orthree bits inputted from the binarizing unit 92 to generate an encodedbit sequence 111, and multiplexes this encoded bit sequence into thebitstream 30. Hereafter, an arithmetic encoding procedure based on thecontext information will be explained.

The arithmetic encoding processing operation unit 104 refers to thecontext information memory 96 first to acquire the context information106 based on the context identification information 102 corresponding tothe bin 0 of the binary signal 103. Next, the arithmetic encodingprocessing operation unit 104 refers to the probability table memory 97to specify the probability 108 of occurrence of the MPS of the bin 0corresponding to the probability table number 107 held by the contextinformation 106.

Next, the arithmetic encoding processing operation unit 104 carries outarithmetic encoding on the symbol value 109 (0 or 1) of the bin 0 on thebasis of the value (0 or 1) of the MPS held by the context information106 and the specified probability 108 of occurrence of the MPS. Next,the arithmetic encoding processing operation unit 104 refers to thestate transition table memory 98 and acquires the probability tablenumber 110 at a time after the symbol of the bin 0 is encoded on thebasis of both the probability table number 107 held by the contextinformation 106, and the symbol value 109 of the bin 0 on whicharithmetic encoding has been carried out previously.

Next, the arithmetic encoding processing operation unit 104 updates thevalue of the probability table number (i.e. the probability table number107) of the context information 106 of the bin 0 stored in the contextinformation memory 96 to the probability table number at a time afterthe state transition (i.e. the probability table number 110 at a timeafter the symbol of the bin 0 is encoded, which has been previouslyacquired from the state transition table memory 98).

The arithmetic encoding processing operation unit 104 also carries outarithmetic encoding based on the context information 106 identified bythe context identification information 102 on the symbol of each of thebins 1 and 2, and then updates the context information 106 afterencoding the symbol of each of the bins, like in the case of carryingout arithmetic encoding on the symbol of the bin 0. The arithmeticencoding processing operation unit 104 outputs an encoded bit sequence111 which the arithmetic encoding processing operation unit has acquiredby carrying out arithmetic encoding on the symbols of all the bins, andthe variable length encoding unit 23 multiplexes the encoded bitsequence into the bitstream 30.

As mentioned above, the context information 106 identified by thecontext identification information 102 is updated every time whenarithmetic encoding is carried out on the symbol of each bin. Morespecifically, this update means that the probability state of each nodemakes a transition every time when the symbol of each bin is encoded.Initialization of the context information 106, i.e. reset of theprobability state is carried out by the above-mentioned initializingunit 90. While the initializing unit 90 initializes the contextinformation in accordance with an instruction shown by the contextinformation initialization flag 91 of the encoding controlling unit 3,the initializing unit 90 carries out this initialization at the head ofeach slice or the like. A plurality of sets can be prepared in advancefor the initial state of each context information 106 (the value of theMPS, and the initial value of the probability table number whichapproximates the probability of occurrence of the value), and theencoding controlling unit 3 can include information showing whichinitial state is to be selected from the plurality of sets in thecontext information initialization flag 91 and notify this contextinformation initialization flag to the initializing unit 90.

The binarization table updating unit 95 refers to the frequencyinformation 94 showing the frequency of occurrence of the index value ofthe parameter to be encoded (in this case, the optimum encoding mode 7a) which is generated by the frequency information generating unit 93 onthe basis of the binarization table update flag 113 notified theretofrom the encoding controlling unit 3 to update the binarization tablememory 105.

Hereafter, a procedure for updating the binarization table which iscarried out by the binarization table updating unit 95 will beexplained.

In this example, the binarization table updating unit updates acorrespondence between the encoding modes in the binarization table andthe indexes in accordance with the frequency of occurrence of theencoding mode specified by the optimum encoding mode 7 a which is theparameter to be encoded in such a way as to be able to binarize theencoding mode having the highest frequency of occurrence into a shortcodeword, thereby reducing the code amount.

FIG. 14 is a view showing an example of the binarization table updated.Assuming that the binarization table which is yet to be updated isplaced in a state shown in FIG. 10, FIG. 14 shows a state in which thebinarization table has been updated. For example, when the frequency ofoccurrence of mb_mode3 is the highest, the binarization table updatingunit 95 assigns the smallest index value to mb_mode3 in accordance withthe frequency information 94 in such a way that a binary signal having ashort codeword is assigned to mb_mode3.

Further, after updating the binarization table, the binarization tableupdating unit 95 needs to generate binarization table updateidentification information 112 for enabling the decoding device toidentify the updated binarization table and multiplex the binarizationtable update identification information into the bitstream 30. Forexample, when there are a plurality of binarization tables for eachparameter to be encoded, an ID for enabling the identification of eachparameter to be encoded can be provided in advance for both the encodingdevice and the decoding device, and the binarization table updating unit95 can be constructed in such a way as to output the ID of thebinarization table updated as binarization table updating identificationinformation 112, and multiplex this binarization table updateidentification information into the bitstream 30.

The encoding controlling unit 3 carries out control of an update time byreferring to the frequency information 94 of the parameter to be encodedat the head of each slice, and, when determining that the distributionof the frequency of occurrence of the parameter to be encoded haschanged and deviated from a predetermined permissible range, outputtinga binarization table update flag 113. The variable length encoding unit23 should just multiplex the binarization table update flag 113 into theslice header of the bitstream 30. Further, when the binarization tableupdate flag 113 shows “there is an update of the binarization table”,the variable length encoding unit 23 multiplexes the binarization tableupdating identification information 112 showing which binarization tableof the binarization tables of the encoding mode, a compressionparameter, and a prediction parameter has been updated into thebitstream 30.

Further, the encoding controlling unit 3 can notify the update of thebinarization table at a time other than the time that the encodingcontrolling unit processes the head of each slice. For example, theencoding controlling unit can output the binarization table update flag113 at the time that the encoding controlling unit processes the head ofan arbitrary macroblock to instruct an update of the binarization table.In this case, the binarization table updating unit 95 needs to outputinformation for identifying the position of the macroblock for which thebinarization table has been updated, and the variable length encodingunit 23 also needs to multiplex the information into the bitstream 30.

When outputting the binarization table update flag 113 to thebinarization table updating unit 95 to cause this binarization tableupdating unit to update the binarization table, the encoding controllingunit 3 needs to output the context information initialization flag 91 tothe initializing unit 90 to cause the initializing unit to initializethe context information memory 96.

Next, a variable length decoding unit 61 of the moving image decodingdevice in accordance with this Embodiment 2 will be explained. FIG. 15is a block diagram showing the internal structure of the variable lengthdecoding unit 61 of the moving image decoding device in accordance withEmbodiment 2 of the present invention. Further, because the structure ofthe moving image decoding device in accordance with this Embodiment 2 isthe same as that in accordance with above-mentioned Embodiment 1, andthe operation of each component except the variable length decoding unit61 is the same as that in accordance with above-mentioned Embodiment 1,an explanation will be made by using FIGS. 1 to 8.

The variable length decoding unit 61 shown in FIG. 15 includes anarithmetic decoding processing operation unit 127 for referring tocontext identification information 126 which a context generating unit122 generates, a context information memory 128, a probability tablememory 131, and a state transition table memory 135 to carry outarithmetic decoding on an encoded bit sequence 133 showing an optimumencoding mode 62 (or an optimum prediction parameter 63 or an optimumcompression parameter 65) multiplexed into a bitstream 60 to generate abinary signal 137, a binarization table memory 143 for storing abinarization table 139 indicating a correspondence between the optimumencoding mode 62 expressed by a binary signal (or an optimum predictionparameter 63 or an optimum compression parameter 65) and a multi valuedsignal, and an inverse binarizing unit 138 for converting the binarysignal 137 which the arithmetic decoding processing operation unit 127has generated into a decoded value 140 of a multi valued signal by usingthe binarization table 139.

Hereafter, a variable length decoding procedure carried out by thevariable length decoding unit 61 will be explained by taking the optimumencoding mode 62 of a macroblock included in the bitstream 60 as anexample of a parameter to be entropy-decoded. Because the variablelength decoding unit 61 can also variable-length-decode an optimumprediction parameter 63 or an optimum compression parameter 65 which issimilarly a parameter to be decoded in accordance with the sameprocedure as that in accordance with which the variable length decodingunit variable-length-decodes the optimum encoding mode 62, theexplanation of the variable length decoding procedure carried out on anoptimum prediction parameter or an optimum compression parameter will beomitted.

Context initialization information 121, an encoded bit sequence 133, abinarization table update flag 142, and binarization table updatingidentification information 144 which are multiplexed into the bitstream60 by the encoding device are included in the bitstream 60 in accordancewith this Embodiment 2. The details of each of these pieces ofinformation will be mentioned later.

An initializing unit 120 initializes the context information stored inthe context information memory 128 at the head of each slice or thelike. As an alternative, a plurality of sets can be prepared for aninitial state of the context information (the value of the MPS, and aninitial value of the probability table number which approximates theprobability of occurrence of the MPS value) in the initializing unit120, and an initial state corresponding to the decoded value of thecontext initialization information 121 can be selected from theplurality of sets.

The context generating unit 122 refers to both a type indicating signal123 showing the type of the parameter to be decoded (the optimumencoding mode 62, an optimum prediction parameter 63, or an optimumcompression parameter 65) and peripheral block information 124 togenerate context identification information 126.

The type indicating signal 123 shows the type of the parameter to bedecoded, and the decoding device determines what the parameter to bedecoded is in accordance with a syntax held by the variable lengthdecoding unit 61. Therefore, the encoding device and the decoding deviceneed to hold the same syntax, and, in this embodiment, it is assumedthat the encoding controlling unit 3 of the encoding device holds thesyntax. The encoding device sequentially outputs the type of theparameter to be encoded next and the value (index value) of theparameter, i.e. the type indicating signal 100 to the variable lengthencoding unit 23 in accordance with the syntax held by the encodingcontrolling unit 3.

Further, the peripheral block information 124 includes the encoding modewhich is acquired by decoding each macroblock or subblock, and is storedin a memory (not shown) in the variable length decoding unit 61 in orderto use the peripheral block information 124 as information used forsubsequent decoding of a macroblock or subblock and is outputted to thecontext generating unit 122 as needed.

A generation procedure for generating context identification information126 which is carried out by the context generating unit 122 is the sameas the operation of the context generating unit 99 disposed in theencoding device. Also the context generating unit 122 in the decodingdevice generates context identification information 126 for each bin ofthe binarization table 139 which is to be referred to by the inversebinarizing unit 138.

In the context information of each bin, the value (0 or 1) of the MPS,and the probability table number for specifying the probability ofoccurrence of the value of the MPS are held as probability informationused for carrying out arithmetic decoding on the bin. Further, theprobability table memory 131 and the state transition table memory 135store the same probability table (FIG. 11) as the probability tablememory 97 of the encoding device and the same state transition table(FIG. 12) as the state transition table memory 98 of the encodingdevice, respectively.

The arithmetic decoding processing operation unit 127 carries outarithmetic decoding on the encoded bit sequence 133 multiplexed into thebitstream 60 on a per-bin basis to generate a binary signal 137, andoutputs this binary signal to the inverse binarizing unit 138.

The arithmetic decoding processing operation unit 127 refers to thecontext information memory 128 first to acquire the context information129 based on the context identification information 126 corresponding toeach bin of the encoded bit sequence 133. Next, the arithmetic decodingprocessing operation unit 127 refers to the probability table memory 131to specify the probability 132 of occurrence of the MPS of each bincorresponding to the probability table number 130 held by the contextinformation 129.

The arithmetic decoding processing operation unit 127 then carries outarithmetic decoding on the encoded bit sequence 133 inputted to thearithmetic decoding processing operation unit 127 on the basis of thevalue (0 or 1) of the MPS held by the context information 129 and thespecified probability 132 of occurrence of the MPS to acquire the symbolvalue 134 (0 or 1) of each bin. After acquiring the symbol value of eachbin through the decoding, the arithmetic decoding processing operationunit 127 refers to the state transition table memory 135, and acquiresthe probability table number 136 at a time after the symbol of each binis decoded (at a time after a state transition is made) on the basis ofthe symbol value 134 of each decoded bin and the probability tablenumber 130 held by the context information 129 and in accordance withthe same procedure as that carried out by the arithmetic encodingprocessing operation unit 104 of the encoding device.

Next, the arithmetic decoding processing operation unit 127 updates thevalue of the probability table number (i.e. the probability table number130) of the context information 129 of each bin which is stored in thecontext information memory 128 to the probability table number at a timeafter a state transition is made (i.e. the probability table number 136at a time after the symbol of each bin is decoded which has beenpreviously acquired from the state transition table memory 135). Thearithmetic decoding processing operation unit 127 outputs a binarysignal 137 in which the symbols of the bins acquired as results ofperforming the above-mentioned arithmetic decoding on the encoded bitsequence are connected to one another to the inverse binarizing unit138.

The inverse binarizing unit 138 selects the same binarization table 139as that used at the time of the encoding from among the binarizationtables stored in the binarization table memory 143 and prepared for allthe types of parameters to be decoded and refers to the binarizationtable selected thereby, and selectively outputs the decoded value 140 ofthe parameter to be decoded from the binary signal 137 inputted theretofrom the arithmetic decoding processing operation unit 127. When thetype of the parameter to be decoded is the encoding mode (optimumencoding mode 62) of a macroblock, the binarization table 139 is thesame as the binarization table in the encoding device shown in FIG. 10.

The binarization table updating unit 141 updates the binarization tablestored in the binarization table memory 143 on the basis of thebinarization table update flag 142 and the binarization table updatingidentification information 144 which are decoded from the bitstream 60.

The binarization table update flag 142 is information which correspondsto the binarization table update flag 113 in the encoding device, andwhich is included in the header information or the like of the bitstream60 and shows whether or not there is an update to the binarizationtable. When the decoded value of the binarization table update flag 142shows “there is an update to the binarization table”, the binarizationtable updating identification information 144 is decoded from thebitstream 60.

The binarization table updating identification information 144 isinformation which corresponds to the binarization table updatingidentification information 112 in the encoding device, and which is usedfor identifying the binarization table of a parameter updated by theencoding device. For example, when a plurality of binarization tablesare provided in advance for each parameter to be encoded, as mentionedabove, an ID which enables each parameter to be encoded to be identifiedand an ID of each of the binarization tables are provided in advanceboth in the encoding device side and in the decoding device, and thebinarization table updating unit 141 updates the binarization tablecorresponding to the ID value in the binarization table updatingidentification information 144 which is decoded from the bitstream 60.In this example, two types of binarization tables shown in FIGS. 10 and14, and IDs of these binarization tables are prepared in advance in thebinarization table memory 143, and, when it is assumed that thebinarization table yet to be updated is placed in a state shown in FIG.10, the binarization table updating unit 141 must necessarily select thebinarization table corresponding to the ID included in the binarizationtable updating identification information 144 by simply carrying out anupdate process in accordance with the binarization table update flag 142and the binarization table updating identification information 144.Therefore, the binarization table updated enters a state shown in FIG.14, and becomes the same as the binarization table which has beenupdated in the encoding device.

As mentioned above, the moving image encoding device in accordance withEmbodiment 2 is constructed in such a way that the encoding controllingunit 3 selects and outputs a parameter to be encoded, such as an optimumencoding mode 7 a which provides an optimum degree of encodingefficiency, an optimum prediction parameter 10 a or 18 a, or an optimumcompression parameter 20 a, the binarizing unit 92 of the variablelength encoding unit 23 converts the parameter to be encoded expressedby a multi valued signal into a binary signal 103 by using thebinarization table stored in the binarization table memory 105, thearithmetic encoding processing operation unit 104 carries out arithmeticencoding on the binary signal 103 to output an encoded bit sequence 111,the frequency information generating unit 93 generates frequencyinformation 94 of the parameter to be encoded, and the binarizationtable updating unit 95 updates the correspondence between the multivalued signal in the binarization table and the binary signal on thebasis of the frequency information 94, the code amount can be reducedwhile the encoded video having the same quality is generated, ascompared with the conventional method having the binarization tablewhich is fixed at all times.

Further, because the binarization table updating unit 95 is constructedin such a way as to multiplex both the binarization table updatingidentification information 112 showing whether or not there is an updateto the binarization table, and the binarization table updatingidentification information 112 for identifying the binarization tableupdated into the bitstream 30, the moving image decoding device inaccordance with Embodiment 2 is constructed in accordance with thestructure of the binarization table updating unit in such a way that thearithmetic decoding processing operation unit 127 of the variable lengthdecoding unit 61 carries out arithmetic decoding on the encoded bitsequence 133 multiplexed into the bitstream 60 to generate a binarysignal 137, the inverse binarizing unit 138 uses the binarization table139 of the binarization table memory 143 to convert the binary signal137 into a multi valued signal and acquire a decoded value 140, and thebinarization table updating unit 141 updates a predeterminedbinarization table stored in the binarization table memory 143 on thebasis of the binarization table update flag 142 and the binarizationtable updating identification information 144 which are acquired throughthe decoding of the header information multiplexed into the bitstream60. Therefore, because the moving image decoding device can update thebinarization table in accordance with the same procedure as that carriedout by the moving image encoding device and can carry out inversebinarization on the parameter to be encoded, the moving image encodingdevice in accordance with Embodiment 2 can decode the encoded bitstreamcorrectly.

Embodiment 3

In this Embodiment 3, a variant of the generating process of generatinga prediction image by using a motion-compensated prediction which ismade by the motion-compensated prediction unit 9 in the moving imageencoding device and the moving image decoding device in accordance withany one of above-mentioned Embodiments 1 and 2 will be explained

First, a motion-compensated prediction unit 9 of a moving image encodingdevice in accordance with this Embodiment 3 will be explained. Further,because the structure of the moving image encoding device in accordancewith this Embodiment 3 is the same as that in accordance withabove-mentioned Embodiment 1 or 2, and the operation of each componentexcept the motion-compensated prediction unit 9 is the same as that inaccordance with above-mentioned Embodiment 1 or 2, an explanation willbe made by using FIGS. 1 to 15.

The motion-compensated prediction unit 9 in accordance with thisEmbodiment 3 has the same structure as and operates in the same way asthat in accordance with above-mentioned Embodiment 1 or 2, with theexception that a structure and an operation associated with a predictionimage generating process having virtual sample accuracy differ fromthose in accordance with any one of above-mentioned Embodiments 1 and 2.More specifically, in accordance with above-mentioned Embodiments 1 and2, as shown in FIG. 3, the interpolated image generating unit 43 of themotion-compensated prediction unit 9 generates reference image datahaving virtual pixel accuracy, such as half-pixel or ¼ pixel accuracy,and, when generating a prediction image 45 on the basis of thisreference image data having virtual pixel accuracy, generates virtualpixels by implementing an interpolation arithmetic operation with a6-tap filter using six integer pixels running in a vertical orhorizontal direction to generate a prediction image, like in the case ofthe MPEG-4 AVC standards. In contrast with this, the motion-compensatedprediction unit 9 in accordance with this Embodiment 3 enlarges areference image 15 having integer pixel accuracy stored in amotion-compensated prediction frame memory 14 by carrying out a superresolution process on the reference image 15 to generate a referenceimage 207 having virtual pixel accuracy, and then generates a predictionimage on the basis of this reference image 207 having virtual pixelaccuracy.

Next, the motion-compensated prediction unit 9 in accordance with thisEmbodiment 3 will be explained by using FIG. 3. Like that in accordancewith any one of above-mentioned Embodiments 1 and 2, an interpolatedimage generating unit 43 in accordance with this Embodiment 3 specifiesone or more frames of reference images 15 from the motion-compensatedprediction frame memory 14, and a motion detecting unit 42 detects amotion vector 44 in a predetermined motion search range on the referenceimage 15 specified by the interpolated image generating unit. Thedetection of the motion vector is implemented by using a motion vectorhaving virtual pixel accuracy, like in the case of the MPEG-4 AVCstandards or the like. In accordance with this detecting method, aninterpolation arithmetic operation is performed on pixel information(referred to as integer pixels) which the reference image has togenerate virtual samples (pixels) between the integer pixels, and thesevirtual samples are used as a reference image.

In order to generate a reference image having virtual pixel accuracy, itis necessary to enlarge a reference image having integer pixel accuracy(generate a reference image having a higher resolution) to generate asample plane which consists of virtual pixels. To this end, when areference image for movement search having virtual pixel accuracy isrequired, the interpolated image generating unit 43 in accordance withthis Embodiment 3 uses a super resolution technique disclosed by “W. T.Freeman, E. C. Pasztor and O. T. Carmichael, “Learning Low-LevelVision”, International Journal of Computer Vision, vol. 40, No. 1, 2000”to generate a reference image having virtual pixel accuracy. In thefollowing explanation, a structure in which the motion-compensatedprediction unit 9 carries out a super resolution image generatingprocess to generate a reference image 207 having virtual pixel accuracyfrom the reference image data stored in the motion-compensatedprediction frame memory 14, and the motion detecting unit 42 carries outa motion vector search process using the reference image will bementioned hereafter.

FIG. 16 is a block diagram showing the internal structure of theinterpolated image generating unit 43 of the motion-compensatedprediction unit 9 of the moving image encoding device in accordance withEmbodiment 3 of the present invention. The interpolated image generatingunit 43 shown in FIG. 16 includes an image enlargement processing unit205 for carrying out an enlarging process on the reference image 15stored in the motion-compensated prediction frame memory 14, an imagereduction processing unit 200 for carrying out a reducing process on thereference image 15, a high frequency feature extracting unit 201 a forextracting a feature quantity of a high frequency region component fromthe image reduction processing unit 200, a high frequency featureextracting unit 201 b for extracting a feature quantity of a highfrequency region component from the reference image 15, a correlationcalculating unit 202 for calculating the value of a correlation betweenthe feature quantities, a high frequency component estimating unit 203for estimating a high frequency component from both the value of thecorrelation and prior learned data stored in a high frequency componentpattern memory 204, and an adding unit 206 for correcting a highfrequency component of the enlarged image by using the estimated highfrequency component to generate a reference image 207 having virtualpixel accuracy.

In the interpolated image generating unit shown in FIG. 16, when thereference image 15 in the range used for a motion search process isinputted from the reference image data stored in the motion-compensatedprediction frame memory 14 to the interpolated image generating unit 43,this reference image 15 is inputted to the image reduction processingunit 200, to the high frequency feature extracting unit 201 b, and tothe image enlargement processing unit 205.

The image reduction processing unit 200 generates a reduced image whoseheight and width are respectively reduced to 1/N times (N is a power of2, such as 2 or 4) the original height and width from the referenceimage 15, and outputs the reduced image to the high frequency featureextracting unit 201 a. A typical image reduction filter implements thisreducing process.

The high frequency feature extracting unit 201 a extracts a firstfeature quantity associated with a high frequency component, such as anedge component, from the reduced image which is generated by the imagereduction processing unit 200. As the first feature quantity, forexample, a parameter showing a DCT in a local block or a Wavelettransform coefficient distribution can be used.

The high frequency feature extracting unit 201 b carries out a highfrequency feature extracting process similar to that carried out by thehigh frequency feature extracting unit 201 a, and extracts a secondfeature quantity having a frequency component region different from thatof the first feature quantity from the reference image 15. The secondfeature quantity is outputted to the correlation calculating unit 202,and is also outputted to the high frequency component estimating unit203.

When the first feature quantity is inputted from the high frequencyfeature extracting unit 201 a and the second feature quantity isinputted from the high frequency feature extracting unit 201 b, thecorrelation calculating unit 202 calculates the value of afeature-quantity-based correlation in a high frequency component regionbetween the reference image 15 and the reduced image in units of onelocal block. As this value of the correlation, for example, a distancebetween the first feature quantity and the second feature quantity iscalculated.

The high frequency component estimating unit 203 specifies a priorlearned pattern of the high frequency component from the high frequencycomponent pattern memory 204 on the basis of both the second featurequantity inputted thereto from the high frequency feature extractingunit 201 b, and the value of the correlation inputted thereto from thecorrelation calculating unit 202, and estimates and generates a highfrequency component which the reference image 207 having virtual pixelaccuracy should have. The generated high frequency component isoutputted to the adding unit 206.

The image enlargement processing unit 205 performs either aninterpolation arithmetic operation with a 6-tap filter using six integerpixels running in a vertical or horizontal direction or enlargementfiltering, such as bilinear filtering, on the inputted reference image15, like in the case of performing a generating process of generatingsamples having half pixel accuracy in accordance with the MPEG-4 AVCstandards, to enlarge each of the height and width of the referenceimage 15 by N times to generate an enlarged image.

The adding unit 206 adds the high frequency component inputted theretofrom the high frequency component estimating unit 203 to the enlargedimage inputted thereto from the image enlargement processing unit 205 togenerate an enlarged reference image. More specifically, the adding unitcorrects the high frequency component of the enlarged image to generatean enlarged reference image whose height and width are respectivelyenlarged to N times the original height and width. The interpolatedimage generating unit 43 uses this enlarged reference image data as areference image 207 having virtual pixel accuracy in which 1/N is set to1.

The interpolated image generating unit 43 can be alternativelyconstructed in such a way as to, after generating a reference image 207having half pixel (½ pixel) accuracy by setting N to 2, generate virtualsamples (pixels) having ¼ pixel accuracy by performing an interpolationarithmetic operation using a filter for acquiring a mean value ofadjacent ½ pixels or integer pixels.

Further, the interpolated image generating unit 43 can be constructed insuch a way as to include a unit for switching whether or not to add thehigh frequency component outputted by the high frequency componentestimating unit 203 to the enlarged image outputted by the imageenlargement processing unit 205 to control the result of the generationof the reference image 207 having virtual pixel accuracy in addition tothe structure shown in FIG. 16. In the case in which the interpolatedimage generating unit is constructed in this way, there is provided anadvantage of suppressing a bad influence upon the encoding efficiencywhen the estimation accuracy of the high frequency component estimatingunit 203 is bad for some reason such as an exceptional image pattern.When the adding unit 206 selectively determines whether or not to addthe high frequency component outputted by the high frequency componentestimating unit 203 to the enlarged image, the moving image encodingdevice generates a prediction image 45 for both the case of adding themand the case of not adding them and then carries out amotion-compensated prediction, and encodes the results of themotion-compensated prediction and determines one of the predictionimages which provides a higher degree of efficiency. The moving imageencoding device then multiplexes adding process information showingwhether the adding unit has added the high frequency component to theenlarged image into the bitstream 30 as control information.

As an alternative, the interpolated image generating unit 43 canuniquely determine whether or not to add the high frequency component tothe enlarged image from another parameter to be multiplexed into thebitstream 30 to control the adding process carried out by the addingunit 206. As an example of determining whether or not to add the highfrequency component to the enlarged image from another parameter, forexample, there can be provided a method of using the type of an encodingmode 7 as shown in FIG. 2A or 2B. When an encoding mode showing that thedivision of a macroblock into motion compensation region blocks is fineis selected, there is a high probability that the image pattern has aviolent movement. Therefore, in this case, by assuming that the effectof the super resolution is low, the interpolated image generating unit43 controls the adding unit 206 to cause this adding unit not to add thehigh frequency component outputted by the high frequency componentestimating unit 203 to the enlarged image. In contrast, when either anencoding mode showing that the size of each motion compensation regionblock in a macroblock is large or an intra prediction mode in which theblock size is large is selected, there is a high probability that theimage pattern is a relatively-stationary image area. Therefore, in thiscase, by assuming that the effect of the super resolution is low, theinterpolated image generating unit 43 controls the adding unit 206 tocause this adding unit to add the high frequency component outputted bythe high frequency component estimating unit 203 to the enlarged image.

As an example of using another parameter other than the encoding mode 7,a parameter, such as the size of the motion vector or a variation in themotion vector field in consideration of adjacent areas, can be used. Theinterpolated image generating unit 43 of the motion-compensatedprediction unit 9 shares the type of the parameter with the decodingdevice to determine whether or not to add the high frequency componentto the enlarged image. In this case, the moving image encoding devicedoes not have to multiplex the control information about the addingprocess directly into the bitstream 30, thereby being able to improvethe compression efficiency.

The moving image encoding device can be constructed in such a way as toperform the above-mentioned super resolution process on the referenceimage 15, which is to be stored in the motion-compensated predictionframe memory 14, to convert the reference image into a reference image207 having virtual pixel accuracy before storing the reference image inthe motion-compensated prediction frame memory 14, and, after that,store the reference image 207 in the motion-compensated prediction framememory. In the case of this structure, although the size of a memoryrequired as the motion-compensated prediction frame memory 14 increases,the moving image encoding device does not have to sequentially carry outthe super resolution process during the motion vector search and duringthe prediction image generation and the processing load on themotion-compensated prediction process itself can be reduced, and themoving image encoding device becomes able to carry out the frameencoding process and the generating process of generating a referenceimage 207 having virtual pixel accuracy in parallel, and can speed upthe processes.

Hereafter, an example of a motion vector detection procedure fordetecting a motion vector having virtual pixel accuracy using thereference image 207 having virtual pixel accuracy will be shown by usingFIG. 3.

Motion Vector Detection Procedure I′

The interpolated image generating unit 43 generates a prediction image45 for the motion vector 44 having integer pixel accuracy in thepredetermined motion search range of a motion compensation region blockimage 41. The prediction image 45 (prediction image 17) generated atinteger pixel accuracy is outputted to the subtraction unit 12, and issubtracted from the motion compensation region block image 41(macro/subblock image 5) by the subtraction unit 12, so that the resultof the subtraction is defined as a prediction difference signal 13. Theencoding controlling unit 3 evaluates a degree of prediction efficiencyfor the prediction difference signal 13 and for the motion vector 44(prediction parameter 18) having integer pixel accuracy. Because theevaluation of this prediction efficiency can be carried out inaccordance with the above equation (1) explained in above-mentionedEmbodiment 1, the explanation of the evaluation will be omittedhereafter.

Motion Vector Detection Procedure II′

The interpolated image generating unit 43 generates a prediction image45 by using the reference image 207 having virtual pixel accuracygenerated within the interpolated image generating unit 43 shown in FIG.16 for a motion vector 44 having ½ pixel accuracy located in thevicinity of the motion vector having integer pixel accuracy which isdetermined in accordance with the above-mentioned “motion vectordetection procedure I”. After that, like in the case of theabove-mentioned “motion vector detection procedure I”, the predictionimage 45 (prediction image 17) generated at ½ pixel accuracy issubtracted from the motion compensation region block image 41(macro/subblock image 5) by the subtraction unit 12 to acquire aprediction difference signal 13. Next, the encoding controlling unit 3evaluates a degree of prediction efficiency for this predictiondifference signal 13 and for the motion vector 44 (prediction parameter18) having ½ pixel accuracy, and selectively determines a motion vector44 having ½ pixel accuracy which minimizes the prediction cost J₁ fromamong one or more motion vectors having ½ pixel accuracy located in thevicinity of the motion vector having integer pixel accuracy.

Motion Vector Detection Procedure III′

Also as to a motion vector having ¼ pixel accuracy, the encodingcontrolling unit 3 and the motion-compensated prediction unit 9selectively determine a motion vector 44 having ¼ pixel accuracy whichminimizes the prediction cost J₁ from one or more motion vectors having¼ pixel accuracy located in the vicinity of the motion vector having ½pixel accuracy which is determined in accordance with theabove-mentioned “motion vector detection procedure II”.

Motion Vector Detection Procedure IV′

After that, the encoding controlling unit 3 and the motion-compensatedprediction unit 9 similarly detect a motion vector having virtual pixelaccuracy until the motion vector detected thereby has a predetermineddegree of accuracy.

Thus, the motion-compensated prediction unit 9 outputs thevirtual-pixel-accuracy motion vector having the predetermined accuracy,which is determined for each motion compensation region block image 41which is one of a plurality of blocks into which the macro/subblockimage 5 is divided and each of which is a unit for the motioncompensation shown by the encoding mode 7, and the identification numberof the reference image specified by the motion vector as predictionparameters 18. The motion-compensated prediction unit 9 also outputs theprediction image 45 (prediction image 17) which is generated by usingthe prediction parameters 18 to the subtraction unit 12, and thesubtraction unit 12 subtracts the prediction image 45 from themacro/subblock image 5 to acquire a prediction difference signal 13. Theprediction difference signal 13 outputted from the subtraction unit 12is outputted to the transformation/quantization unit 19. Becausesubsequent processes carried out after that are the same as thoseexplained in above-mentioned Embodiment 1, the explanation of theprocesses will be omitted hereafter.

Next, the moving image decoding device in accordance with thisEmbodiment 3 will be explained. Because the moving image decoding devicein accordance with this Embodiment 3 has the same structure as themoving image decoding device in accordance with any one ofabove-mentioned Embodiments 1 and 2, with the exception that the movingimage decoding device in accordance with this Embodiment 3 has astructure different from the structure associated with the predictionimage generating process having virtual pixel accuracy carried out bythe motion-compensated prediction unit 70 in accordance with any one ofabove-mentioned Embodiments 1 and 2, and the moving image decodingdevice in accordance with this Embodiment 3 operates in a different wayfrom that in accordance with any one of above-mentioned Embodiments 1and 2 when carrying out the prediction image generating process, thestructure and operation of the moving image decoding device inaccordance with this Embodiment 3 will be explained by using FIGS. 1 to16.

In accordance with any one of above-mentioned Embodiments 1 and 2, whengenerating a prediction image on the basis of a reference image havingvirtual pixel accuracy, such as half-pixel or ¼ pixel accuracy, themotion-compensated prediction unit 70 generates virtual pixels byimplementing an interpolation arithmetic operation with a 6-tap filterusing six integer pixels running in a vertical or horizontal direction,or the like to generate a prediction image, like in the case of theMPEG-4 AVC standards. In contrast with this, a motion-compensatedprediction unit 70 in accordance with this Embodiment 3 enlarges areference image 76 having integer pixel accuracy stored in amotion-compensated prediction frame memory 75 by carrying out a superresolution process on the reference image. As a result, themotion-compensated prediction unit generates a reference image havingvirtual pixel accuracy.

The motion-compensated prediction unit 70 in accordance with thisEmbodiment 3 generates a prediction image 72 from the reference image 76stored in the motion-compensated prediction frame memory 75 on the basisof motion vectors included in the inputted optimum prediction parameters63, the identification number (reference image index) of the referenceimage specified by each of the motion vectors, and so on, and outputsthe prediction image, like that in accordance with any one ofabove-mentioned Embodiments 1 and 2. An adding unit 73 adds theprediction image 72 inputted from the motion-compensated prediction unit70 to prediction difference signal decoded values 67 inputted from aninverse quantization/inverse transformation unit 66 to generate adecoded image 74.

A generation method of generating the prediction image 72 which isimplemented by the motion-compensated prediction unit 70 corresponds tothe operation of the motion-compensated prediction unit 9 in theencoding device from which the process of searching through a pluralityof reference images for motion vectors (corresponding to the operationsof the motion detecting unit 42 and the interpolated image generatingunit 43 shown in FIG. 3) is excluded. The motion-compensated predictionunit carries out only the process of generating the prediction image 72in accordance with optimum prediction parameters 63 provided theretofrom a variable length decoding unit 61.

When generating a prediction image 72 at virtual pixel accuracy, themotion-compensated prediction unit 70 carries out the same process asthat shown in FIG. 16 on the reference image 76 stored in themotion-compensated prediction frame memory 75 and specified by theidentification number (reference image index) of the reference image togenerate a reference image having virtual pixel accuracy, and thengenerates a prediction image 72 by using the decoded motion vector. Atthis time, when the encoding device has selectively determined whetheror not to add the high frequency component outputted by the highfrequency component estimating unit 203 shown in FIG. 16 to the enlargedimage, the decoding device extracts the control information showingwhether the encoding device has carries out the adding process from thebitstream 60, or uniquely determines whether the encoding device hasadded the high frequency component to the enlarged image from anotherparameter to control an adding process in the motion-compensatedprediction unit 70. In the case of using another parameter to determinewhether the encoding device has added the high frequency component tothe enlarged image, a parameter, such as the size of the motion vectoror a variation in the motion vector field in consideration of adjacentareas, can be used. The motion-compensated prediction unit 70 shares thetype of the parameter with the encoding device and determines whetherthe encoding device has added the high frequency component to theenlarged image. As a result, the moving image encoding device does nothave to multiplex the control information about the adding processdirectly into the bitstream 30, thereby being able to improve thecompression efficiency.

The motion-compensated prediction unit 70 can carry out the process ofgenerating a reference image having virtual pixel accuracy only when themotion vectors included in the optimum prediction parameters 18 a whichare outputted from the encoding device (i.e. optimum predictionparameters 63 in the decoding device) indicate the virtual pixelaccuracy. In this structure, the motion-compensated prediction unit 9switches between the use of the reference image 15 stored in themotion-compensated prediction frame memory 14, and the generation anduse of a reference image 207 having virtual pixel accuracy by means ofthe interpolated image generating unit 43 in accordance with the motionvector, and generates a prediction image 17 from either the referenceimage 15 or the reference image 207 having virtual pixel accuracy.

As an alternative, the motion-compensated prediction unit can beconstructed in such a way as to carry out the process shown in FIG. 16on the reference image which is yet to be stored in themotion-compensated prediction frame memory 75 and store the referenceimage having virtual pixel accuracy on which the enlargement process hasbeen carried out and in which a high frequency component has beencorrected in the motion-compensated prediction frame memory 75. In thecase of this structure, although the size of a memory which should beprepared as the motion-compensated prediction frame memory 75 increases,it is not necessary to duplicately carry out the process shown in FIG.16 when the number of times that the motion vector points to a pixel atthe same virtual sample position. Therefore, the amount of computationcan be reduced. Further, in a case in which the range of displacementwhich is pointed to by the motion vector is known in advance by thedecoding device, the motion-compensated prediction unit 70 can beconstructed in such a way as to carry out the process shown in FIG. 16on the target region while limiting this region only to the range. Whatis necessary is just to make the decoding device know the range ofdisplacement which is pointed to by the motion vector by, for example,multiplexing a value range showing the range of displacement which ispointed to by the motion vector into the bitstream 60 to transmit thevalue range to the decoding device, or making both the encoding deviceand the decoding device mutually determine and set the value range intheir operations.

As mentioned above, the moving image encoding device in accordance withEmbodiment 3 is constructed in such a way that the motion-compensatedprediction unit 9 has the interpolated image generating unit 43 forcarrying out an enlarging process on the reference image 15 stored inthe motion-compensated prediction frame memory 14, and also correcting ahigh frequency component to generate a reference image 207 havingvirtual pixel accuracy, and switches between the use of the referenceimage 15 or the generation and use of the reference image 207 havingvirtual pixel accuracy in accordance with the motion vector to generatea prediction image 17, even when carrying out high compression on theinputted video signal 1 including many high frequency components, suchas fine edges, the moving image encoding device can generate theprediction image 17 which is to be generated by using amotion-compensated prediction from the reference image including manyhigh frequency components, thereby being able to compression-encode theinputted video signal efficiently.

Further, also the moving image decoding device in accordance withEmbodiment 3 is constructed in such a way that the motion-compensatedprediction unit 70 has the interpolated image generating unit forgenerating a reference image having virtual pixel accuracy in accordancewith the same procedure as that carried out by the moving image encodingdevice, and switches between the use of the reference image 76 stored inthe motion-compensated prediction frame memory 75 or the generation anduse of the reference image having virtual pixel accuracy in accordancewith the motion vector multiplexed into the bitstream 60 to generate aprediction image 72, the moving image decoding device can correctlydecode the bitstream encoded by the moving image encoding device inaccordance with Embodiment 3.

The interpolated image generating unit 43 in accordance withabove-mentioned Embodiment 3 carries out the super resolution processbased on the above-mentioned technique disclosed by W. T. Freeman et al.(2000) to generate a reference image 207 having virtual pixel accuracy.However, the super resolution process is not limited the one based onthe above-mentioned technique, and the interpolated image generatingunit can be constructed in such a way as to use another arbitrary superresolution technique to generate a reference image 207 having virtualpixel accuracy.

Further, in a case in which the moving image encoding device inaccordance with any one of above-mentioned Embodiments 1 to 3 isconstructed of a computer, a moving image encoding program in which theprocesses carried out by the block dividing unit 2, the encodingcontrolling unit 3, the switching unit 6, the intra-prediction unit 8,the motion-compensated prediction unit 9, the motion-compensatedprediction frame memory 14, the transformation/quantization unit 19, theinverse quantization/inverse transformation unit 22, the variable lengthencoding unit 23, the loop filter unit 27, and the memory 28 for intraprediction are described can be stored in a memory of the computer, anda CPU of the computer can be made to execute the moving image encodingprogram stored in the memory. Similarly, in a case in which the movingimage decoding device in accordance with any one of above-mentionedEmbodiments 1 to 3 is constructed of a computer, a moving image decodingprogram in which the processes carried out by the variable lengthdecoding unit 61, the inverse quantization/inverse transformation unit66, the switching unit 68, the intra-prediction unit 69, themotion-compensated prediction unit 70, the motion-compensated predictionframe memory 75, the memory 77 for intra prediction, and the loop filterunit 78 are described can be stored in a memory of the computer, and aCPU of the computer can be made to execute the moving image decodingprogram stored in the memory.

INDUSTRIAL APPLICABILITY

Because the moving image encoding device and the moving image decodingdevice in accordance with the present invention can switch amongtransformation block sizes adaptively to compression-encode an inputtedmoving image for each region which serves as a unit formotion-compensated prediction in each macroblock, the moving imageencoding device and the moving image decoding device in accordance withthe present invention are suitable for use as a moving image encodingdevice which divides a moving image into predetermined regions to encodethe moving image on a per-region basis and as a moving image decodingdevice which decodes an encoded moving image on aper-predetermined-region basis.

EXPLANATIONS OF REFERENCE NUMERALS

-   1 inputted video signal, 2 block dividing unit, 3 encoding    controlling unit, 4 macroblock size, 5 macro/subblock image, 6    switching unit, 7 encoding mode, 7 a optimum encoding mode, 8    intra-prediction unit, 9 motion-compensated prediction unit, 10    prediction parameter, 10 a optimum prediction parameter, 11    prediction image, 12 subtraction unit, 13 prediction difference    signal, 13 a optimum prediction differential signal, 14    motion-compensated prediction frame memory, 15 reference image, 17    prediction image, 18 prediction parameter, 18 a optimum prediction    parameter, 19 transformation/quantization unit, 20 compression    parameter, 20 a optimum compression parameter, 21 compressed data,    22 inverse quantization/inverse transformation unit, 23 variable    length encoding unit, 24 local decoded prediction difference signal,    25 adding unit, 26 local decoded image signal, 27 loop filter unit,    28 memory for intra prediction, 29 local decoded image, 30    bitstream, 40 motion compensation region dividing unit, 41 motion    compensation region block image, 42 motion detecting unit, 43    interpolated image generating unit, 44 motion vector, 45 prediction    image, 50 transformation block size dividing unit, 51 transformation    object block, 52 transformation unit, 53 transform coefficients, 54    quantizing unit, 60 bitstream, 61 variable length decoding unit, 62    optimum encoding mode, 63 optimum prediction parameter, 64    compressed data, 65 optimum compression parameter, 66 inverse    quantization/inverse transformation unit, 67 prediction difference    signal decoded value, 68 switching unit, 69 intra-prediction unit,    70 motion-compensated prediction unit, 71 prediction image, 72    prediction image, 73 adding unit, 74 and 74 a decoded image, 75    motion-compensated prediction frame memory, 76 reference image, 77    memory for intra prediction, 78 loop filter unit, 79 reproduced    image, 90 initializing unit, 91 context information initialization    flag, 92 binarizing unit, 93 frequency information generating unit,    94 frequency information, 95 binarization table updating unit, 96    context information memory, 97 probability table memory, 98 state    transition table memory, 99 context generating unit, 100 type    indicating signal, 101 peripheral blocks information, 102 context    identification information, 103 binary signal, 104 arithmetic    encoding processing operation unit, 105 binarization table memory,    106 context information, 107 probability table number, 108 MPS    probability of occurrence, 109 symbol value, 110 probability table    number, 111 encoded bit sequence, 112 binarization table updating    identification information, 113 binarization table update flag, 120    initializing unit, 121 context initialization information, 122    context generating unit, 123 type indicating signal, 124 peripheral    blocks information, 126 context identification information, 127    arithmetic decoding processing operation unit, 128 context    information memory, 129 context information, 130 probability table    number, 131 probability table memory, 132 MPS probability of    occurrence, 133 encoded bit sequence, 134 symbol value, 135 state    transition table memory, 136 probability table number, 137 binary    signal, 138 inverse binarizing unit, 139 binarization table, 140    decoded value, 141 binarization table updating unit, 142    binarization table update flag, 143 binarization table memory, 144    binarization table updating identification information, 200 image    reduction processing unit, 201 a and 201 b high frequency feature    extracting unit, 202 correlation calculating unit, 203 high    frequency component estimating unit, 204 high frequency component    pattern memory, 205 image enlarging process unit, 206 adding unit,    207 reference image having virtual pixel accuracy.

1. A moving image decoding device which decodes a bit stream generatedby dividing an image of a moving image into a plurality of blocks and bycompression-encoding the blocks and obtains the moving image, the movingimage decoding device comprising: a motion-compensated predictor togenerate an inter prediction image of one of the blocks by interprediction processing on the block; a transformer to generate a decodedprediction difference signal by inverse transforming and inversequantizing on compressed data of the block on a basis of a compressedparameter indicating transformation block size of the block; adder togenerate the moving image by adding the inter prediction image to thedecoded prediction difference signal; and a variable-length decoder toentropy-decode the bit stream in order to obtain a binary string andobtain the compressed parameter from the binary string, wherein thevariable-length decoder obtains an identifier from bit stream, theidentifier specifying a table from a plurality of binarization tableseach of which defines a binary string assignment to the compressedparameter, and obtains the compressed parameter by inverse binarizingthe binary string in accordance with the specified binarization table.2. A moving image decoding method for decoding a bit stream generated bydividing an image of a moving image into a plurality of blocks and bycompression-encoding the blocks and obtains the moving image, the movingimage decoding method comprising: obtaining a binary string byentropy-decoding the bit stream; obtaining a compressed parameter byinverse binarizing the binary string in accordance with a binarizationtable which is specified with an identifier from a plurality ofbinarization tables each of which defines a binary string assignment tothe compressed parameter, the identifier being obtained from the bitstream; generating an inter prediction image of one of the blocks byinter prediction processing on the block; generating a decodedprediction difference signal by inverse transforming and inversequantizing compressed data of the block on a basis of the compressedparameter indicating transformation block size of the block; andgenerating the moving image by adding the inter prediction image to thedecoded prediction difference signal.
 3. A moving image encoding devicewhich generates a bit stream by dividing an image of a moving image intoa plurality of blocks and by compression-encoding the blocks, the movingimage encoding device comprising: a motion-compensated predictor togenerate an inter prediction image of one of the blocks by interprediction processing on the block; a transformer to generate compresseddata by transforming and quantizing a decoded prediction differencesignal on a basis of a compressed parameter indicating transformationblock size of the block, the decoded prediction difference signal isgenerated by subtracting the inter prediction image from the block; anda variable-length encoder to binarize the compressed parameter to abinary string and entropy-encode the binary string into the bit stream,wherein the variable-length encoder carries out the binarizationaccording to a binarization table specified with an identifier from aplurality of binarization tables, each of which defines a binary stringassignment to the compressed parameter, and encodes the identifier intoa binary string.
 4. A moving image encoding method of generating a bitstream by dividing an image of a moving image into a plurality of blocksand by compression-encoding the blocks, the moving image encoding methodcomprising: generating an inter prediction image of one of the blocks byinter prediction processing on the block; generating compressed data bytransforming and quantizing a decoded prediction difference signal on abasis of a compressed parameter indicating transformation block size ofthe block, the decoded prediction difference signal is generated bysubtracting the inter prediction image from the block; binarizing thecompressed parameter to a binary string in accordance with abinarization table which is specified with an identifier from aplurality of binarization tables each of which defines a binary stringassignment to the compressed parameter, the identifier being encodedinto the bit stream; and entropy-encoding the binary string into a bitstream.
 5. A non-transitory computer-readable medium storing a bitstream which is generated by dividing an image of a moving image into aplurality of blocks and by compression-encoding the blocks, the bitstream comprising; compressed data generated by transforming andquantizing a decoded prediction difference signal on a basis of acompressed parameter indicating transformation block size of the block,the decoded prediction difference signal is generated by subtracting theinter prediction image from the block; an identifier specifying one of aplurality of binarization tables each of which defines a binary stringassignment to the compressed parameter; and a binary string encoded withentropy-encoding, the binary string being obtained by binarizing thecompressed parameter in accordance with the binarization table specifiedby the identifier.